rbmatlab  1.13.10
 All Classes Namespaces Files Functions Variables Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
TwoPhaseFlow.DetailedModel Class Reference

Detailed Description

IDetailedModel implementation for a two phase flow system.

This is a detailed model for a problem of this type

Definition at line 18 of file DetailedModel.m.

Inheritance diagram for TwoPhaseFlow.DetailedModel:
Inheritance graph
[legend]
Collaboration diagram for TwoPhaseFlow.DetailedModel:
Collaboration graph
[legend]

Public Member Functions

 DetailedModel (ModelDescr descr)
 constructor
 
function
sim_data = 
detailed_simulation (ModelData model_data)
 executes a detailed simulation for a given parameter
 
function
sim_data = 
detailed_simulation_galerkin (IDetailedData detailed_data)
 executes a detailed simulation for a given parameter
 
function
sim_data = 
detailed_simulation_impes (ModelData model_data)
 executes a detailed simulation for a given parameter
 
function ModelData
model_data = 
gen_model_data ()
 method which produces all \(H\)-dependent data, that is required for a detailed simulations and is independent of the parameter \(\mu\).
 
function p = plot_sim_data (ModelData model_data, sim_data, plot_params)
 plots the simulation data as returned by detailed_simulation()
 
function  plot_error_sequence (errs)
 
- Public Member Functions inherited from Greedy.User.FVDetailedModelDefault
 FVDetailedModelDefault (ModelDescr descr)
 Constructor for this class.
 
function UON = orthonormalize (ModelData model_data, U)
 orthonormalizes a set of discrete functions \(\{ v_h^l \}_{l=1}^L\)
 
function U0 = init_values_algorithm (ModelData model_data)
 computes the Dof vectors for the initial value function \(u_h^0(\cdot;t\mu) = {\cal P}_h[u_0(\mu)]\)
 
function UV = inner_product (ModelData model_data, U, V)
 computes the inner project between the Dof vectors of two discrete functions
 
- Public Member Functions inherited from Greedy.User.IDetailedModel
 IDetailedModel (descr)
 constructor
 
- Public Member Functions inherited from IDetailedModel
 IDetailedModel (descr)
 constructor
 
function
isequal = 
eq (IDetailedModel other)
 overloaded equality (==) operator, by default comparing the descr variables
 
function IDetailedModel this = set_mu (mu)
 sets the active parameter vector \(\mu \in {\cal M}\)
 
function mu = get_mu ()
 returns the active parameter vector \(\boldsymbol\mu \in {\cal M}\)
 
virtual function
sim_data = 
detailed_simulation (model_data)
 executes a detailed simulation for a given parameter
 
virtual function p = plot_sim_data (model_data, sim_data, plot_params)
 plots the simulation data as returned by detailed_simulation()
 

Static Public Member Functions

static function U = get_dofs_from_sim_data (sim_data)
 extracts the \(H\) dimensional Dof vector from the sim_data structure
 
static function
snapshot = 
get_dofs_at_time (sim_data, time_index)
 
static function errs = l2_error_sequence_algorithm (U, Uapprox,ModelData model_data)
 computes the \(L^2(\Omega)\) error for each "snapshot" of a trajectories and returns the sequence of these errors.
 
static function errs = l2_error_sequence_complete (U, Uapprox,ModelData model_data)
 
static function errs = linfty_error_sequence_complete (U, Uapprox,ModelData model_data)
 
- Static Public Member Functions inherited from Greedy.User.FVDetailedModelDefault
static function errs = linfty_error_sequence_algorithm (U, Uapprox,ModelData model_data)
 computes the \(L^{\infty}(\Omega)\) error for each "snapshot" of a trajectories and returns the sequence of these errors.
 
static function W = get_inner_product_matrix (ModelData model_data)
 returns the inner product matrix for efficient computation of inner products on \({\cal W}_h\)
 

Public Attributes

 t
 current time instance
 
 tstep
 current time step
 
 compute_conditions = false
 boolean flag indicating whether conditions of system matrices shall be computed.
 

Static Public Attributes

static const  newton_checks
 This constant is used for a consistency check of the model descr with help of DetailedModelBaseIf.struct_check()
 

Constructor & Destructor Documentation

TwoPhaseFlow.DetailedModel.DetailedModel ( ModelDescr  descr)

constructor

This checks and stores the model description structure

Parameters
descrstructure
Required fields of descr:
  • newton_solver —  boolean flag indicating whether we are using a Newton scheme for the discretization.

Definition at line 89 of file DetailedModel.m.

Member Function Documentation

function sim_data = TwoPhaseFlow.DetailedModel.detailed_simulation ( ModelData  model_data)

executes a detailed simulation for a given parameter

Parameters
model_dataMatlab structure storing (possibly) high dimensional data needed by IDetailedModel.detailed_simulation().
Return values
sim_datastructure holding the \(H\)-dimensional simulation data.
fldebug output holding the flux evaluations returned by the L_E_local_ptr operator.
Required fields of model:
  • T —  final time
  • nt —  number of time-steps \(0 = t_0 \leq t_1 \leq \cdots \leq t^K+1 = T\), i.e. \(K+1\).
  • init_values_algorithm —  function pointer for computing the initvalues-DOF with arguments (model, model_data)
    • example: fv_init_values()
  • L_E_local_ptr —  function pointer to the local space-discretization operator evaluation with syntax
    INC_local = L_local(U_local_ext, ind_local, grid_local_ext)
    where *_local indicates results on a set of elements, *_local_ext includes information including their neighbours, i.e. the grid must be known also for the neighbours, the values of the previous timstep must be known on the neighbours. The subset of elements, which are to be computed are given in ind_local and the values produced are INC_local. A time-step can then be realized by
    NU_local = U_local_ext(ind_local) - dt * INC_local
Required fields of model_data:
  • gn_edges —  gn edges
Optional fields of model:
  • data_const_in_time —  if this optional field is 1, the time evolution is performed with constant operators, i.e. only the initial-time-operators are computed and used throughout the time simulation.
Generated fields of sim_data:
  • U —  matrix of size \(H \times K+1\) holding for each time step the solution dof vector.
  • Unewton —  matrix of size \(H \times K+1+\sum_{k=0}^K n_{\text{Newton}}(k)\) holding for each time step and each Newton iteration the intermediate solution dof vectors.
  • S —  S
  • Stemp —  Stemp
  • Utemp —  Utemp
  • P —  P
  • Ptemp —  Ptemp
  • exit_flags —  exit flags
  • outputs —  outputs

Definition at line 19 of file detailed_simulation.m.

function sim_data = TwoPhaseFlow.DetailedModel.detailed_simulation_galerkin ( IDetailedData  detailed_data)

executes a detailed simulation for a given parameter

Parameters
detailed_dataobject defining the basis generation algorithm and storage for storing high dimensional data, i.e. dependent on dimension \(H\). This data is necessary for detailed simulations, construction of online matrices, reduced_data and reconstruction of reduced simulations.
Return values
sim_datastructure holding the \(H\)-dimensional simulation data.
fldebug output holding the flux evaluations returned by the L_E_local_ptr operator.
Required fields of model:
  • T —  final time
  • nt —  number of time-steps \(0 = t_0 \leq t_1 \leq \cdots \leq t^K+1 = T\), i.e. \(K+1\).
  • init_values_algorithm —  function pointer for computing the initvalues-DOF with arguments (model, model_data)
    • example: fv_init_values()
  • L_E_local_ptr —  function pointer to the local space-discretization operator evaluation with syntax
    INC_local = L_local(U_local_ext, ind_local, grid_local_ext)
    where *_local indicates results on a set of elements, *_local_ext includes information including their neighbours, i.e. the grid must be known also for the neighbours, the values of the previous timstep must be known on the neighbours. The subset of elements, which are to be computed are given in ind_local and the values produced are INC_local. A time-step can then be realized by
    NU_local = U_local_ext(ind_local) - dt * INC_local
Optional fields of model:
  • data_const_in_time —  if this optional field is 1, the time evolution is performed with constant operators, i.e. only the initial-time-operators are computed and used throughout the time simulation.
Generated fields of sim_data:
  • U —  matrix of size \(H \times K+1\) holding for each time step the solution dof vector.
  • Unewton —  matrix of size \(H \times K+1+\sum_{k=0}^K n_{\text{Newton}}(k)\) holding for each time step and each Newton iteration the intermediate solution dof vectors.
  • sat_a —  sat a
  • vel_a —  vel a
  • prs_a —  prs a
  • S —  S
  • P —  P
  • exit_flags —  exit flags
  • outputs —  outputs

Definition at line 19 of file detailed_simulation_galerkin.m.

function sim_data = TwoPhaseFlow.DetailedModel.detailed_simulation_impes ( ModelData  model_data)

executes a detailed simulation for a given parameter

Parameters
model_dataMatlab structure storing (possibly) high dimensional data needed by IDetailedModel.detailed_simulation().
Return values
sim_datastructure holding the \(H\)-dimensional simulation data.
fldebug output holding the flux evaluations returned by the L_E_local_ptr operator.
Required fields of model:
  • T —  final time
  • nt —  number of time-steps \(0 = t_0 \leq t_1 \leq \cdots \leq t^K+1 = T\), i.e. \(K+1\).
Required fields of model_data:
  • gn_edges —  gn edges
Optional fields of model:
  • data_const_in_time —  if this optional field is 1, the time evolution is performed with constant operators, i.e. only the initial-time-operators are computed and used throughout the time simulation.
Generated fields of sim_data:
  • U —  matrix of size \(H \times K+1\) holding for each time step the solution dof vector.
  • Unewton —  matrix of size \(H \times K+1+\sum_{k=0}^K n_{\text{Newton}}(k)\) holding for each time step and each Newton iteration the intermediate solution dof vectors.
  • S —  S
  • P —  P
  • exit_flags —  exit flags
  • outputs —  outputs

Definition at line 19 of file detailed_simulation_impes.m.

function ModelData model_data = TwoPhaseFlow.DetailedModel.gen_model_data ( )
virtual

method which produces all \(H\)-dependent data, that is required for a detailed simulations and is independent of the parameter \(\mu\).

Return values
model_datamodel data
Generated fields of model_data:
  • W —  inner product weighting matrix
  • grid —  a structure containing geometry information of a mesh used for discretizations
  • gn_edges —  gn edges
  • diamondW —  diamondW
  • diamondWinv —  diamondWinv
  • opdata —  opdata
  • opdata.S_upper —  opdata.S upper
  • opdata.S_lower —  opdata.S lower

Implements IDetailedModel.

Definition at line 19 of file gen_model_data.m.

static function U = TwoPhaseFlow.DetailedModel.get_dofs_from_sim_data (   sim_data)
staticvirtual

extracts the \(H\) dimensional Dof vector from the sim_data structure

Parameters
sim_datamatlab struct with simulation data generated e.g. by detailed_simulation() or rb_reconstruction() methods.
Return values
U\(H\) dimensional Dof vector

Implements Greedy.User.IDetailedModel.

Definition at line 134 of file DetailedModel.m.

static function errs = TwoPhaseFlow.DetailedModel.l2_error_sequence_algorithm (   U,
  Uapprox,
ModelData  model_data 
)
staticvirtual

computes the \(L^2(\Omega)\) error for each "snapshot" of a trajectories and returns the sequence of these errors.

Parameters
Ufirst sequence of Dof vectors of discrete functions \(\{u_h^k\}_{k=0}^K\) stored in a H x K+1 matrix
Uapproxsecond sequence of Dof vectors of functions \(\{v_h^k\}_{k=0}^K\) stored in a H x K+1 matrix
model_dataMatlab structure storing (possibly) high dimensional data needed by IDetailedModel.detailed_simulation().
Return values
errssequence of errors \(\{ \| u_h^k - v_h^k \|_{L^2(\Omega)} \}_{k=0}^{K}\) stored in a K+1 x 1 vector

This function calls fv_l2_error()

Reimplemented from Greedy.User.FVDetailedModelDefault.

Definition at line 197 of file DetailedModel.m.

function p = TwoPhaseFlow.DetailedModel.plot_sim_data ( ModelData  model_data,
  sim_data,
  plot_params 
)

plots the simulation data as returned by detailed_simulation()

function plotting simulation results

Parameters
model_dataMatlab structure storing (possibly) high dimensional data needed by IDetailedModel.detailed_simulation().
sim_datasimulation data structure as returned by detailed_simulation()
plot_paramsstructure which controls the plot output
Return values
pMatlab GUI handle to figure window
Required fields of sim_data:
  • P —  P
  • U —  U
  • S —  S
  • t —  t
  • gEI —  gEI
Required fields of model_data:
  • gEI —  gEI
  • grid —  a structure containing geometry information of a mesh used for discretizations
Optional fields of plot_params:
  • plot —  function pointer to a function plotting a single snapshot for a specific time instant. (default = descr.plot)

Definition at line 19 of file plot_sim_data.m.

Member Data Documentation

TwoPhaseFlow.DetailedModel.compute_conditions = false

boolean flag indicating whether conditions of system matrices shall be computed.


Default: false

Definition at line 78 of file DetailedModel.m.

TwoPhaseFlow.DetailedModel.newton_checks
static
Initial value:
= struct(" \
'newton_steps', {{\@isscalar}}, \
'newton_epsilon', {{\@isscalar}}
")

This constant is used for a consistency check of the model descr with help of DetailedModelBaseIf.struct_check()

This check is only executed if we use a Newton scheme


Default: struct(" \ 'newton_steps', {{@isscalar}}, \ 'newton_epsilon', {{@isscalar}} ")

Definition at line 34 of file DetailedModel.m.

TwoPhaseFlow.DetailedModel.t

current time instance

Note
This property has the MATLAB attribute Dependent set to true.
Matlab documentation of property attributes.

Definition at line 54 of file DetailedModel.m.

TwoPhaseFlow.DetailedModel.tstep

current time step

Note
This property has the MATLAB attribute Dependent set to true.
Matlab documentation of property attributes.

Definition at line 65 of file DetailedModel.m.


The documentation for this class was generated from the following files: