Flow123d  master-f44eb46
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | Static Private Member Functions | Private Attributes | List of all members
RichardsLMH Class Reference

Edge lumped mixed-hybrid solution of unsteady Darcy flow. More...

#include <richards_lmh.hh>

Inheritance diagram for RichardsLMH:
Inheritance graph
[legend]
Collaboration diagram for RichardsLMH:
Collaboration graph
[legend]

Classes

class  EqData
 
class  EqFields
 

Public Member Functions

 RichardsLMH (Mesh &mesh, const Input::Record in_rec, TimeGovernor *tm=nullptr)
 
void accept_time_step () override
 postprocess velocity field (add sources) More...
 
virtual ~RichardsLMH () override
 
- Public Member Functions inherited from DarcyLMH
 TYPEDEF_ERR_INFO (EI_Reason, string)
 
 DECLARE_EXCEPTION (ExcSolverDiverge,<< "Diverged nonlinear solver. Reason: "<< EI_Reason::val)
 
 DECLARE_INPUT_EXCEPTION (ExcMissingTimeGovernor,<< "Missing the key 'time', obligatory for the transient problems.")
 
 DarcyLMH (Mesh &mesh, const Input::Record in_rec, TimeGovernor *tm=nullptr)
 CREATE AND FILL GLOBAL MH MATRIX OF THE WATER MODEL. More...
 
void init_eq_data ()
 
void initialize () override
 
void zero_time_step () override
 
void update_solution () override
 
void solve_time_step (bool output=true)
 Solve the problem without moving to next time and without output. More...
 
virtual void postprocess ()
 
virtual void output_data () override
 Write computed fields. More...
 
virtual double solved_time () override
 
EqFieldseq_fields ()
 
EqDataeq_data ()
 
void set_extra_storativity (const Field< 3, FieldValue< 3 >::Scalar > &extra_stor)
 Sets external storarivity field (coupling with other equation). More...
 
void set_extra_source (const Field< 3, FieldValue< 3 >::Scalar > &extra_src)
 Sets external source field (coupling with other equation). More...
 
virtual ~DarcyLMH () override
 
- Public Member Functions inherited from DarcyFlowInterface
 DECLARE_EXCEPTION (ExcBddcmlNotSupported,<< "Flow123d was not build with BDDCML support.\n")
 
 DECLARE_EXCEPTION (ExcUnknownSolver,<< "Unknown solver type. Internal error.\n")
 
 DarcyFlowInterface (Mesh &mesh, const Input::Record in_rec)
 
virtual ~DarcyFlowInterface ()
 
- Public Member Functions inherited from EquationBase
 EquationBase ()
 
 EquationBase (Mesh &mesh, const Input::Record in_rec)
 
virtual ~EquationBase ()
 
virtual void choose_next_time ()
 
virtual void set_time_upper_constraint (double dt, std::string message)
 
virtual void set_time_lower_constraint (double dt, std::string message)
 
TimeGovernortime ()
 
virtual void set_time_governor (TimeGovernor &time)
 
double planned_time ()
 
Meshmesh ()
 
std::shared_ptr< Balancebalance () const
 
TimeMark::Type mark_type ()
 
FieldSeteq_fieldset ()
 
std::shared_ptr< FieldSeteq_fieldset_ptr ()
 
void init_user_fields (Input::Array user_fields, FieldSet &output_fields)
 

Static Public Member Functions

static const Input::Type::Recordget_input_type ()
 
- Static Public Member Functions inherited from DarcyLMH
static const Input::Type::Selectionget_mh_mortar_selection ()
 Selection for enum MortarMethod. More...
 
static const Input::Type::Recordtype_field_descriptor ()
 
static const Input::Type::Recordget_input_type ()
 
- Static Public Member Functions inherited from DarcyFlowInterface
static Input::Type::Abstractget_input_type ()
 
- Static Public Member Functions inherited from EquationBase
static Input::Type::Recordrecord_template ()
 Template Record with common keys for derived equations. More...
 
static Input::Type::Recorduser_fields_template (std::string equation_name)
 Template Record with common key user_fields for derived equations. More...
 

Protected Member Functions

bool zero_time_term (bool time_global=false) override
 
void initialize_specific () override
 
void assembly_linear_system () override
 
void initialize_asm () override
 Create and initialize assembly objects. More...
 
void read_init_cond_asm () override
 Call assemble of read_init_cond_assembly_ and init_cond_postprocess_assembly_. More...
 
- Protected Member Functions inherited from DarcyLMH
void solve_nonlinear ()
 Solve method common to zero_time_step and update solution. More...
 
void create_linear_system (Input::AbstractRecord rec)
 
void allocate_mh_matrix ()
 
void print_matlab_matrix (string matlab_file)
 Print darcy flow matrix in matlab format into a file. More...
 
std::vector< int > get_component_indices_vec (unsigned int component) const
 Get vector of all DOF indices of given component (0..side, 1..element, 2..edge) More...
 
LinSyslin_sys_schur ()
 Getter for the linear system of the 2. Schur complement. More...
 

Static Protected Attributes

static const int registrar
 Registrar of class to factory. More...
 

Static Private Member Functions

static std::string equation_name ()
 

Private Attributes

std::shared_ptr< EqFieldseq_fields_
 
std::shared_ptr< EqDataeq_data_
 
GenericAssembly< InitCondPostprocessAssembly > * init_cond_postprocess_assembly_
 general assembly object, hold assembly objects of appropriate dimension More...
 

Additional Inherited Members

- Public Types inherited from DarcyFlowInterface
enum  MortarMethod { NoMortar = 0 , MortarP0 = 1 , MortarP1 = 2 }
 Type of experimental Mortar-like method for non-compatible 1d-2d interaction. More...
 
typedef DarcyFlowInterface FactoryBaseType
 Typedef for usage of Input::Factory in child classes. More...
 
- Protected Attributes inherited from DarcyLMH
std::shared_ptr< Balancebalance_
 
DarcyFlowMHOutputoutput_object
 
int size
 
bool data_changed_
 
double tolerance_
 
unsigned int min_n_it_
 
unsigned int max_n_it_
 
std::shared_ptr< EqFieldseq_fields_
 
std::shared_ptr< EqDataeq_data_
 
GenericAssembly< ReadInitCondAssemblyLMH > * read_init_cond_assembly_
 general assembly objects, hold assembly objects of appropriate dimension More...
 
GenericAssemblyBasemh_matrix_assembly_
 
GenericAssemblyBasereconstruct_schur_assembly_
 
- Protected Attributes inherited from EquationBase
bool equation_empty_
 flag is true if only default constructor was called More...
 
Meshmesh_
 
TimeGovernortime_
 
Input::Record input_record_
 
std::shared_ptr< FieldSeteq_fieldset_
 
std::shared_ptr< Balancebalance_
 object for calculation and writing the mass balance to file. More...
 

Detailed Description

Edge lumped mixed-hybrid solution of unsteady Darcy flow.

The time term and sources are evenly distributed form an element to its edges. This applies directly to the second Schur complement. After this system for pressure traces is solved we reconstruct pressures and side flows as follows:

  1. Element pressure is average of edge pressure. This is in fact same as the MH for steady case so we let SchurComplement class do its job.
  2. We let SchurComplement to reconstruct fluxes and then account time term and sources which are evenly distributed from an element to its sides. It can be proved, that this keeps continuity of the fluxes over the edges.

This lumping technique preserves discrete maximum principle for any time step provided one use acute mesh. But in practice even worse meshes are tractable.

Ideas how to unify steady and unsteady flow: zero_time_step:

  1. Set initial time.
  2. Read initial condition. Reconstruct pressures.
  3. Assembly system (possibly in matrix free way).
  4. Reconstruct velocities (schur complement resolve).
  5. Solve iteratively as regular time step if an input flag "steady_initial_time" is set.
  6. (Detect that there is no time term. I such case use arbitrary long time step up to next change of data. Some kind of time step estimator would be nice.

update solution:

  1. Move to the next time.
  2. Update fields
  3. Nonlinear solve.
  4. In case of slow convergence, use shorter time-step, within estimated limits. Otherwise there is a different problem.

Definition at line 65 of file richards_lmh.hh.

Constructor & Destructor Documentation

◆ RichardsLMH()

RichardsLMH::RichardsLMH ( Mesh mesh,
const Input::Record  in_rec,
TimeGovernor tm = nullptr 
)

Definition at line 128 of file richards_lmh.cc.

◆ ~RichardsLMH()

RichardsLMH::~RichardsLMH ( )
overridevirtual

Definition at line 255 of file richards_lmh.cc.

Member Function Documentation

◆ accept_time_step()

void RichardsLMH::accept_time_step ( )
overridevirtual

postprocess velocity field (add sources)

Reimplemented from DarcyLMH.

Definition at line 184 of file richards_lmh.cc.

◆ assembly_linear_system()

void RichardsLMH::assembly_linear_system ( )
overrideprotectedvirtual

Assembles linear system matrix for MH. Element by element assembly is done using dim-template assembly class. Assembles only steady part of the equation. TODO:

  • include time term - DONE
  • add support for Robin type sources
  • support for nonlinear solvers - assembly either residual vector, matrix, or both (using FADBAD++) Assembly or update whole linear system.

Reimplemented from DarcyLMH.

Definition at line 208 of file richards_lmh.cc.

◆ equation_name()

static std::string RichardsLMH::equation_name ( )
inlinestaticprivate

Definition at line 134 of file richards_lmh.hh.

Here is the caller graph for this function:

◆ get_input_type()

const Input::Type::Record & RichardsLMH::get_input_type ( )
static

Definition at line 83 of file richards_lmh.cc.

◆ initialize_asm()

void RichardsLMH::initialize_asm ( )
overrideprotectedvirtual

Create and initialize assembly objects.

Reimplemented from DarcyLMH.

Definition at line 241 of file richards_lmh.cc.

◆ initialize_specific()

void RichardsLMH::initialize_specific ( )
overrideprotectedvirtual

Reimplemented from DarcyLMH.

Definition at line 143 of file richards_lmh.cc.

◆ read_init_cond_asm()

void RichardsLMH::read_init_cond_asm ( )
overrideprotectedvirtual

Call assemble of read_init_cond_assembly_ and init_cond_postprocess_assembly_.

Reimplemented from DarcyLMH.

Definition at line 249 of file richards_lmh.cc.

◆ zero_time_term()

bool RichardsLMH::zero_time_term ( bool  time_global = false)
overrideprotectedvirtual

Returns true is the fields involved in the time term have values that makes the time term zero. For time_global==true, it returns true if there are no field descriptors in the input list, so the fields )of the time ter) have their default values for whole simulation. If time_global==false (default), only the actual values are considered.

Reimplemented from DarcyLMH.

Definition at line 194 of file richards_lmh.cc.

Member Data Documentation

◆ eq_data_

std::shared_ptr<EqData> RichardsLMH::eq_data_
private

Definition at line 129 of file richards_lmh.hh.

◆ eq_fields_

std::shared_ptr<EqFields> RichardsLMH::eq_fields_
private

Definition at line 128 of file richards_lmh.hh.

◆ init_cond_postprocess_assembly_

GenericAssembly< InitCondPostprocessAssembly >* RichardsLMH::init_cond_postprocess_assembly_
private

general assembly object, hold assembly objects of appropriate dimension

Definition at line 132 of file richards_lmh.hh.

◆ registrar

const int RichardsLMH::registrar
staticprotected
Initial value:
=
Input::register_class< RichardsLMH, Mesh &, const Input::Record >(equation_name()) +
unsigned int size() const
Returns number of keys in the Record.
Definition: type_record.hh:602
static const Input::Type::Record & get_input_type()
Definition: richards_lmh.cc:83
static std::string equation_name()

Registrar of class to factory.

Definition at line 111 of file richards_lmh.hh.


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