rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules 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 More...
 
function
sim_data = 
detailed_simulation (ModelData model_data)
 executes a detailed simulation for a given parameter More...
 
function
sim_data = 
detailed_simulation_galerkin (IDetailedData detailed_data)
 executes a detailed simulation for a given parameter More...
 
function
sim_data = 
detailed_simulation_impes (ModelData model_data)
 executes a detailed simulation for a given parameter More...
 
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\). More...
 
function p = plot_sim_data (ModelData model_data, sim_data, plot_params)
 plots the simulation data as returned by detailed_simulation() More...
 
function  plot_error_sequence (errs)
 
- Public Member Functions inherited from Greedy.User.FVDetailedModelDefault
 FVDetailedModelDefault (ModelDescr descr)
 Constructor for this class. More...
 
function UON = orthonormalize (ModelData model_data, U)
 orthonormalizes a set of discrete functions \(\{ v_h^l \}_{l=1}^L\) More...
 
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)]\) More...
 
function UV = inner_product (ModelData model_data, U, V)
 computes the inner project between the Dof vectors of two discrete functions More...
 
- Public Member Functions inherited from Greedy.User.IDetailedModel
 IDetailedModel (descr)
 constructor More...
 
- Public Member Functions inherited from IDetailedModel
 IDetailedModel (descr)
 constructor More...
 
function
isequal = 
eq (IDetailedModel other)
 overloaded equality (==) operator, by default comparing the descr variables More...
 
function IDetailedModel this = set_mu (mu)
 sets the active parameter vector \(\mu \in {\cal M}\) More...
 
function mu = get_mu ()
 returns the active parameter vector \(\boldsymbol\mu \in {\cal M}\) More...
 
virtual function
sim_data = 
detailed_simulation (model_data)
 executes a detailed simulation for a given parameter More...
 
virtual function p = plot_sim_data (model_data, sim_data, plot_params)
 plots the simulation data as returned by detailed_simulation() More...
 

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 More...
 
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. More...
 
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. More...
 
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\) More...
 
- Static Public Member Functions inherited from IModel
static function ok = struct_check (descr, checks)
 executes checks on the fields of a structure object More...
 

Public Attributes

 t
 current time instance More...
 
 tstep
 current time step More...
 
 compute_conditions = false
 boolean flag indicating whether conditions of system matrices shall be computed. More...
 
- Public Attributes inherited from IDetailedModel
 descr
 The description structure holding information about the analytical parametrized problem and its discretization. More...
 
 decomp_mode
 
 mu_names
 cell array of strings describing the parameters of the model More...
 
 mu_ranges
 cell array of vectors of size two defining the allowed interval range for the parameter components More...
 
 verbose
 an integer defining the verbosity level of information output during basis generation More...
 
 debug
 an integer defining the debugging level controlling error output and extra tests during basis generation More...
 
- Public Attributes inherited from IModel
 num_cpus = 4
 The number of CPUs used for parallel sessions. More...
 
 decomp_mode
 Decomposition operation mode. More...
 
 mu_names
 cell array of strings describing the parameters of the model More...
 
 mu_ranges
 cell array of vectors of size two defining the allowed interval range for the parameter components More...
 
 verbose
 an integer defining the verbosity level of information output during basis generation More...
 
 debug
 an integer defining the debugging level controlling error output and extra tests during basis generation More...
 

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() More...
 
- Static Public Attributes inherited from IDetailedModel
static const  base_checks
 this structure holds variable names that need to be defined by the descr structure. More...
 
- Static Public Attributes inherited from IModel
static const  time_checks
 This constant can be used for a consistency check of time evolution members in the ModelDescr with help of IModel.struct_check() More...
 

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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: