Flow123d
JS_before_hm-887-g601087d
|
Mixed-hybrid model of linear Darcy flow, possibly unsteady. More...
#include <darcy_flow_mh.hh>
Classes | |
class | EqData |
Public Member Functions | |
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.") | |
DarcyMH (Mesh &mesh, const Input::Record in_rec, TimeGovernor *tm=nullptr) | |
CREATE AND FILL GLOBAL MH MATRIX OF THE WATER MODEL. More... | |
double | last_t () override |
Return last time of TimeGovernor. More... | |
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::VectorFixed > > | get_velocity_field () override |
void | init_eq_data () |
void | initialize () override |
virtual void | initialize_specific () |
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 () |
postprocess velocity field (add sources) More... | |
virtual void | output_data () override |
Write computed fields. More... | |
EqData & | data () |
void | set_extra_storativity (const Field< 3, FieldValue< 3 >::Scalar > &extra_stor) |
void | set_extra_source (const Field< 3, FieldValue< 3 >::Scalar > &extra_src) |
virtual | ~DarcyMH () override |
Public Member Functions inherited from DarcyFlowInterface | |
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) |
TimeGovernor & | time () |
virtual void | set_time_governor (TimeGovernor &time) |
double | planned_time () |
double | solved_time () |
Mesh & | mesh () |
std::shared_ptr< Balance > | balance () const |
TimeMark::Type | mark_type () |
FieldSet & | data () |
Static Public Member Functions | |
static const Input::Type::Selection & | get_mh_mortar_selection () |
Selection for enum MortarMethod. More... | |
static const Input::Type::Record & | type_field_descriptor () |
static const Input::Type::Record & | get_input_type () |
Static Public Member Functions inherited from DarcyFlowInterface | |
static Input::Type::Abstract & | get_input_type () |
Static Public Member Functions inherited from EquationBase | |
static Input::Type::Record & | record_template () |
Template Record with common keys for derived equations. More... | |
Protected Member Functions | |
virtual bool | zero_time_term (bool time_global=false) |
void | solve_nonlinear () |
Solve method common to zero_time_step and update solution. More... | |
void | modify_system () |
virtual void | setup_time_term () |
void | prepare_new_time_step () |
void | create_linear_system (Input::AbstractRecord rec) |
virtual void | read_initial_condition () |
void | allocate_mh_matrix () |
void | assembly_mh_matrix (MultidimAssembly &assembler) |
virtual void | assembly_source_term () |
Source term is implemented differently in LMH version. More... | |
virtual void | assembly_linear_system () |
void | set_mesh_data_for_bddc (LinSys_BDDC *bddc_ls) |
virtual double | solution_precision () const |
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... | |
Protected Attributes | |
std::shared_ptr< Balance > | balance_ |
DarcyFlowMHOutput * | output_object |
int | size |
int | n_schur_compls |
bool | use_steady_assembly_ |
bool | data_changed_ |
double | tolerance_ |
unsigned int | min_n_it_ |
unsigned int | max_n_it_ |
unsigned int | nonlinear_iteration_ |
LinSys * | schur0 |
Vec | steady_diagonal |
Vec | steady_rhs |
Vec | new_diagonal |
Vec | previous_solution |
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::VectorFixed > > | ele_flux_ptr |
Field of flux in barycenter of every element. More... | |
std::shared_ptr< EqData > | data_ |
Protected Attributes inherited from EquationBase | |
bool | equation_empty_ |
flag is true if only default constructor was called More... | |
Mesh * | mesh_ |
TimeGovernor * | time_ |
Input::Record | input_record_ |
FieldSet * | eq_data_ |
std::shared_ptr< Balance > | balance_ |
object for calculation and writing the mass balance to file. More... | |
Static Private Attributes | |
static const int | registrar |
Registrar of class to factory. More... | |
Friends | |
class | DarcyFlowMHOutput |
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... | |
Mixed-hybrid model of linear Darcy flow, possibly unsteady.
Abstract class for various implementations of Darcy flow. In future there should be one further level of abstraction for general time dependent problem.
maybe TODO: split compute_one_step to : 1) prepare_next_timestep 2) actualize_solution - this is for iterative nonlinear solvers Mixed-hybrid of steady Darcy flow with sources and variable density.
solve equations:
where
where is concentration in .
The time key is optional, when not specified the equation is forced to steady regime. Using Steady TimeGovernor which have no dt constraints.
TODO: Make solution regular field (need FeSeystem and parallel DofHandler for edge pressures), then remove get_solution_vector from Equation interface. Model for transition coefficients due to Martin, Jaffre, Roberts (see manual for full reference)
TODO:
TODO: Remove in future. It is supposed not to be improved anymore, however it is kept functioning aside of the LMH lumped version until the LMH version is stable and optimized.
Definition at line 132 of file darcy_flow_mh.hh.
DarcyMH::DarcyMH | ( | Mesh & | mesh_in, |
const Input::Record | in_rec, | ||
TimeGovernor * | tm = nullptr |
||
) |
CREATE AND FILL GLOBAL MH MATRIX OF THE WATER MODEL.
Parameters {Solver,NSchurs} number of performed Schur complements (0,1,2) for water flow MH-system
Definition at line 313 of file darcy_flow_mh.cc.
|
overridevirtual |
Definition at line 1360 of file darcy_flow_mh.cc.
|
protected |
Part of per element assembly that is specific for MH and LMH respectively.
This implemnets MH case:
Definition at line 790 of file darcy_flow_mh.cc.
|
protectedvirtual |
Assembly or update whole linear system.
Definition at line 1053 of file darcy_flow_mh.cc.
|
protected |
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:
Definition at line 766 of file darcy_flow_mh.cc.
|
protectedvirtual |
Source term is implemented differently in LMH version.
Definition at line 903 of file darcy_flow_mh.cc.
|
protected |
Create and preallocate MH linear system (including matrix, rhs and solution vectors)
Definition at line 940 of file darcy_flow_mh.cc.
|
inline |
Definition at line 256 of file darcy_flow_mh.hh.
DarcyMH::DECLARE_EXCEPTION | ( | ExcSolverDiverge | , |
<< "Diverged nonlinear solver. Reason: "<< EI_Reason::val | |||
) |
DarcyMH::DECLARE_INPUT_EXCEPTION | ( | ExcMissingTimeGovernor | , |
<< "Missing the key 'time' | , | ||
obligatory for the transient problems." | |||
) |
|
protected |
Get vector of all DOF indices of given component (0..side, 1..element, 2..edge)
Definition at line 1518 of file darcy_flow_mh.cc.
|
static |
Definition at line 130 of file darcy_flow_mh.cc.
|
static |
Selection for enum MortarMethod.
Definition at line 77 of file darcy_flow_mh.cc.
|
overridevirtual |
Reimplemented from DarcyFlowInterface.
Definition at line 1498 of file darcy_flow_mh.cc.
void DarcyMH::init_eq_data | ( | ) |
|
overridevirtual |
This method should initialize fields of the equation. All members (e.g. number of components) that are necessary for the field initialization must be set between construction and call of initialize. After this method the upper level coupling may set sharing of some fields between equations.
Reimplemented from EquationBase.
Definition at line 406 of file darcy_flow_mh.cc.
|
virtual |
|
inlineoverridevirtual |
Return last time of TimeGovernor.
Implements DarcyFlowInterface.
Definition at line 238 of file darcy_flow_mh.hh.
|
protected |
|
overridevirtual |
Write computed fields.
Reimplemented from EquationBase.
Definition at line 738 of file darcy_flow_mh.cc.
|
virtual |
postprocess velocity field (add sources)
Definition at line 704 of file darcy_flow_mh.cc.
|
protected |
|
protected |
Print darcy flow matrix in matlab format into a file.
Definition at line 1108 of file darcy_flow_mh.cc.
|
protectedvirtual |
Read initial condition into solution vector. Must be called after create_linear_system.
For the LMH scheme we have to be able to save edge pressures in order to restart simulation or use results of one simulation as initial condition for other one.
Definition at line 1415 of file darcy_flow_mh.cc.
|
inline |
Definition at line 261 of file darcy_flow_mh.hh.
|
inline |
Definition at line 258 of file darcy_flow_mh.hh.
|
protected |
type for storage of global to local map
We need:
Definition at line 1181 of file darcy_flow_mh.cc.
|
protectedvirtual |
|
protectedvirtual |
Return a norm of residual vector. TODO: Introduce Equation::compute_residual() updating residual field, standard part of EqData.
Definition at line 754 of file darcy_flow_mh.cc.
|
protected |
Solve method common to zero_time_step and update solution.
Definition at line 615 of file darcy_flow_mh.cc.
void DarcyMH::solve_time_step | ( | bool | output = true | ) |
Solve the problem without moving to next time and without output.
Definition at line 558 of file darcy_flow_mh.cc.
|
static |
DarcyMH::TYPEDEF_ERR_INFO | ( | EI_Reason | , |
string | |||
) |
|
overridevirtual |
Calculation of the next time step and its output.
Reimplemented from EquationBase.
Definition at line 546 of file darcy_flow_mh.cc.
|
overridevirtual |
Initialization of the solution in the zero time.
There may be fields that can not be initialized in the initialize method as they are provided by the coupling. Fields coming from coupling has to be set after the initialize method and before zero_time_step.
Reimplemented from EquationBase.
Definition at line 510 of file darcy_flow_mh.cc.
|
protectedvirtual |
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.
Definition at line 606 of file darcy_flow_mh.cc.
|
friend |
Definition at line 382 of file darcy_flow_mh.hh.
|
protected |
Definition at line 350 of file darcy_flow_mh.hh.
|
protected |
Definition at line 380 of file darcy_flow_mh.hh.
|
protected |
Definition at line 360 of file darcy_flow_mh.hh.
|
protected |
Field of flux in barycenter of every element.
Definition at line 378 of file darcy_flow_mh.hh.
|
protected |
Definition at line 365 of file darcy_flow_mh.hh.
|
protected |
Definition at line 364 of file darcy_flow_mh.hh.
|
protected |
Definition at line 355 of file darcy_flow_mh.hh.
|
protected |
Definition at line 373 of file darcy_flow_mh.hh.
|
protected |
Definition at line 366 of file darcy_flow_mh.hh.
|
protected |
Definition at line 352 of file darcy_flow_mh.hh.
|
protected |
Definition at line 374 of file darcy_flow_mh.hh.
|
staticprivate |
Registrar of class to factory.
Definition at line 388 of file darcy_flow_mh.hh.
|
protected |
Definition at line 369 of file darcy_flow_mh.hh.
|
protected |
Definition at line 354 of file darcy_flow_mh.hh.
|
protected |
Definition at line 371 of file darcy_flow_mh.hh.
|
protected |
Definition at line 372 of file darcy_flow_mh.hh.
|
protected |
Definition at line 363 of file darcy_flow_mh.hh.
|
protected |
Definition at line 359 of file darcy_flow_mh.hh.