20 #include "petscviewer.h" 21 #include "petscerror.h" 50 Saturated water content (($ \theta_s $)). 51 relative volume of the water in a reference volume of a saturated porous media. 57 Residual water content (($ \theta_r $)). 58 Relative volume of the water in a reference volume of an ideally dry porous media. 64 The van Genuchten pressure head scaling parameter (($ \alpha $)). 65 The parameter of the van Genuchten's model to scale the pressure head. 66 Related to the inverse of the air entry pressure, i.e. the pressure where the relative water content starts to decrease below 1. 71 "The van Genuchten exponent parameter (($ n $)).",
"2.0");
89 return it::Record(
"Flow_Richards_LMH",
"Lumped Mixed-Hybrid solver for unsteady saturated Darcy flow.")
93 "Input data for Darcy flow model.")
95 "Selection of the globally applied soil model. In future we replace this key by a field for selection of the model." 96 "That will allow usage of different soil model in a single simulation.")
102 Input::register_class< RichardsLMH, Mesh &, const Input::Record >(
"Flow_Richards_LMH") +
110 data_ = make_shared<EqData>();
120 data_->soil_model_ = std::make_shared<SoilModel_VanGenuchten>();
122 data_->soil_model_ = std::make_shared<SoilModel_Irmay>();
129 data_->phead_edge_.resize( n_local_edges);
130 data_->water_content_previous_it.resize(n_local_sides);
131 data_->water_content_previous_time.resize(n_local_sides);
132 data_->capacity.resize(n_local_sides);
134 Distribution ds_split_edges(n_local_edges, PETSC_COMM_WORLD);
141 ISCreateGeneral(PETSC_COMM_SELF, local_edge_rows.size(),
142 &(local_edge_rows[0]), PETSC_COPY_VALUES, &(is_loc));
163 for (
unsigned int i_loc_el = 0; i_loc_el <
mh_dh.
el_ds->
lsize(); i_loc_el++) {
166 init_value =
data_->init_pressure.value(ele_ac.centre(), ele_ac.element_accessor());
169 int edge_row = ele_ac.edge_row(i);
170 uint n_sides_of_edge = ele_ac.full_iter()->side(i)->edge()->n_sides;
196 data_->water_content_previous_time.copy(
data_->water_content_previous_it);
223 auto multidim_assembler = AssemblyBase::create< AssemblyLMH >(
data_);
285 auto multidim_assembler = AssemblyBase::create< AssemblyLMH >(
data_);
290 multidim_assembler[ele_ac.dim()-1]->update_water_content(ele_ac);
292 double ele_scale = ele_ac.measure() *
293 data_->cross_section.value(ele_ac.centre(), ele_ac.element_accessor()) / ele_ac.n_sides();
294 double ele_source =
data_->water_source_density.value(ele_ac.centre(), ele_ac.element_accessor());
299 side_rows[i] = ele_ac.side_row(i);
300 double water_content =
data_->water_content_previous_it[ele_ac.side_local_idx(i)];
301 double water_content_previous_time =
data_->water_content_previous_time[ele_ac.side_local_idx(i)];
303 values[i] = ele_scale * ele_source - ele_scale * (water_content - water_content_previous_time) /
time_->
dt();
305 VecSetValues(
schur0->
get_solution(), ele_ac.n_sides(), side_rows, values, ADD_VALUES);
void initialize_specific() override
#define ADD_FIELD(name,...)
Output class for darcy_flow_mh model.
void assembly_mh_matrix(MultidimAssembler ma)
void postprocess() override
virtual void start_add_assembly()
virtual PetscErrorCode mat_zero_entries()
RegionSet get_region_set(const string &set_name) const
static const Input::Type::Record & type_field_descriptor()
#define FOR_ELEMENT_SIDES(i, j)
virtual void finish_assembly()=0
const RegionDB & region_db() const
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
static const std::string field_descriptor_record_description(const string &record_name)
FieldCommon & units(const UnitSI &units)
Set basic units of the field.
bool solution_changed_for_scatter
std::shared_ptr< EqData > data_
FLOW123D_FORCE_LINK_IN_CHILD(richards_lmh)
Basic time management class.
std::unordered_map< unsigned int, unsigned int > edge_new_local_4_mesh_idx_
void prepare_new_time_step() override
postprocess velocity field (add sources)
Assembly explicit Schur complement for the given linear system. Provides method for resolution of the...
VecScatter solution_2_edge_scatter_
PETSC scatter from the solution vector to the parallel edge vector with ghost values.
Global macros to enhance readability and debugging, general constants.
std::shared_ptr< Balance > balance_
const Vec & get_solution()
Field< 3, FieldValue< 3 >::Scalar > water_content_saturated
#define START_TIMER(tag)
Starts a timer with specified tag.
static Input::Type::Abstract & get_input_type()
virtual PetscErrorCode rhs_zero_entries()
std::shared_ptr< EqData > data_
Field< 3, FieldValue< 3 >::Scalar > genuchten_p_head_scale
Field< 3, FieldValue< 3 >::Scalar > water_content_residual
Input::Record input_record_
static const Input::Type::Record & get_input_type()
LocalElementAccessorBase< 3 > accessor(uint local_ele_idx)
unsigned int water_balance_idx_
index of water balance within the Balance object.
Field< 3, FieldValue< 3 >::Scalar > genuchten_n_exponent
void read_initial_condition() override
void assembly_linear_system() override
void set_matrix_changed()
static const int registrar
Registrar of class to factory.
Class for representation SI units of Fields.
RichardsLMH(Mesh &mesh, const Input::Record in_rec)
static UnitSI & dimensionless()
Returns dimensionless unit.
Input::Type::Record make_field_descriptor_type(const std::string &equation_name) const
static const Input::Type::Record & get_input_type()
bool zero_time_term() override
void assembly_source_term() override
Source term is implemented differently in LMH version.
#define FEAL_ASSERT(expr)
Definition of assert for debug and release mode.
Mixed-hybrid of steady Darcy flow with sources and variable density.
unsigned int lsize(int proc) const
get local size