Flow123d
JS_before_hm-2203-gd2ee21200
|
Go to the documentation of this file.
18 #ifndef ASSEMBLY_RICHARDS_HH_
19 #define ASSEMBLY_RICHARDS_HH_
28 template <
unsigned int dim>
35 static constexpr
const char *
name() {
return "InitCondPostprocessAssembly"; }
61 if (cell.
dim() != dim)
return;
66 auto p = *( this->
bulk_points(element_patch_idx).begin() );
72 for (
unsigned int i=0; i<cell.
elm()->n_sides(); i++) {
78 fadbad::B<double> x_phead(
phead);
120 template <
template<
IntDim...>
class DimAssembly>
125 template <
unsigned int dim>
132 static constexpr
const char *
name() {
return "MHMatrixAssemblyRichards"; }
180 for (
unsigned int i=0; i<ele->
n_sides(); i++)
224 genuchten_on = (this->eq_fields_->genuchten_p_head_scale.field_result({cell.
elm().region()}) !=
result_zeros);
227 soil_data.
n = this->eq_fields_->genuchten_n_exponent(p);
228 soil_data.
alpha = this->eq_fields_->genuchten_p_head_scale(p);
229 soil_data.
Qr = this->eq_fields_->water_content_residual(p);
230 soil_data.
Qs = this->eq_fields_->water_content_saturated(p);
231 soil_data.
Ks = this->eq_fields_->conductivity(p);
234 this->eq_data_->soil_model_->reset(soil_data);
243 reset_soil_model(cell, p);
244 storativity_ = this->eq_fields_->storativity(p)
245 + this->eq_fields_->extra_storativity(p);
246 VectorMPI water_content_vec = this->eq_fields_->water_content_ptr->vec();
248 for (
unsigned int i=0; i<cell.
elm()->n_sides(); i++) {
251 phead = this->eq_data_->p_edge_solution.
get( edge_indices_[i] );
254 fadbad::B<double> x_phead(phead);
255 fadbad::B<double> evaluated( this->eq_data_->soil_model_->water_content_diff(x_phead) );
257 water_content = evaluated.val();
258 capacity = x_phead.d(0);
260 this->eq_data_->capacity.set( cr_disc_dofs_[i], capacity + storativity_ );
261 water_content_vec.
set( cr_disc_dofs_[i], water_content + storativity_ * phead);
266 double edge_scale,
double edge_source_term)
override
268 update_water_content(dh_cell, p);
270 VectorMPI water_content_vec = eq_fields_->water_content_ptr->vec();
272 for (
unsigned int i=0; i<dh_cell.
elm()->n_sides(); i++) {
273 water_content = water_content_vec.
get( cr_disc_dofs_[i] );
274 water_content_previous_time = eq_data_->water_content_previous_time.get( cr_disc_dofs_[i] );
276 solution[eq_data_->loc_side_dofs[dim-1][i]]
277 += edge_source_term - edge_scale * (water_content - water_content_previous_time) / eq_data_->time_step_;
281 eq_fields_->conductivity_ptr->vec().set( p_dof, compute_conductivity(dh_cell, p) );
287 reset_soil_model(cell, p);
289 double conductivity = 0;
291 for (
unsigned int i=0; i<cell.
elm()->n_sides(); i++)
293 double phead = eq_data_->p_edge_solution.get( eq_data_->loc_schur_[cell.
local_idx()].row_dofs[i] );
294 conductivity += eq_data_->soil_model_->conductivity(phead);
299 conductivity = eq_fields_->conductivity(p);
317 template <
template<
IntDim...>
class DimAssembly>
322 template <
unsigned int dim>
329 static constexpr
const char *
name() {
return "ReconstructSchurAssemblyRichards"; }
355 double edge_scale,
double edge_source_term)
override
372 template <
template<
IntDim...>
class DimAssembly>
BCField< 3, FieldValue< 3 >::Scalar > bc_pressure
arma::Col< IntIdx > LocDofVec
EqFields * eq_fields_
Data objects shared with ConvectionTransport.
void begin() override
Implements AssemblyBase::begin.
FieldSet used_fields_
Sub field set contains fields used in calculation.
Field< 3, FieldValue< 3 >::Scalar > genuchten_p_head_scale
Field< 3, FieldValue< 3 >::Scalar > sigma
double water_content_diff_
RichardsLMH::EqData EqData
void end() override
Implements AssemblyBase::end.
VectorMPI p_edge_solution
LocDofVec cr_disc_dofs_
Vector of local DOF indices pre-computed on different DOF handlers.
BCField< 3, FieldValue< 3 >::Scalar > bc_robin_sigma
LocDofVec edge_indices_
Dofs of discontinuous fields on element edges.
void dirichlet_switch(FMT_UNUSED char &switch_dirichlet, FMT_UNUSED DHCellSide cell_side) override
BCField< 3, FieldValue< 3 >::Scalar > bc_flux
Directing class of FieldValueCache.
Field< 3, FieldValue< 3 >::Scalar > extra_source
Externally added storativity.
void reset_soil_model(const DHCellAccessor &cell, BulkPoint &p)
Base point accessor class.
std::shared_ptr< SoilModelBase > soil_model_
double compute_conductivity(const DHCellAccessor &cell, BulkPoint &p) override
Field< 3, FieldValue< 3 >::Scalar > water_content_residual
Field< 3, FieldValue< 3 >::Scalar > genuchten_n_exponent
unsigned int dim() const
Return dimension of element appropriate to cell.
FieldSet used_fields_
Sub field set contains fields used in calculation.
EqFields * eq_fields_
Data objects shared with ConvectionTransport.
void postprocess_velocity_specific(const DHCellAccessor &dh_cell, BulkPoint &p, arma::vec &solution, double edge_scale, double edge_source_term) override
VectorMPI water_content_previous_time
LocDofVec cr_disc_dofs_
Vector of local DOF indices pre-computed on different DOF handlers.
void set(unsigned int pos, double val)
Set value on given position.
void postprocess_bulk_integral(const DHCellAccessor &cell, unsigned int element_patch_idx) override
Side accessor allows to iterate over sides of DOF handler cell.
InitCondPostprocessAssembly(EqFields *eq_fields, EqData *eq_data)
Constructor.
ReconstructSchurAssemblyRichards(EqFields *eq_fields, EqData *eq_data)
Field< 3, FieldValue< 3 >::Scalar > cross_section
static constexpr const char * name()
void assemble_source_term(const DHCellAccessor &cell, BulkPoint &p) override
void update_water_content(const DHCellAccessor &cell, BulkPoint &p)
std::array< std::vector< unsigned int >, 3 > loc_edge_dofs
DHCellAccessor cell_with_other_dh(const DOFHandlerMultiDim *dh) const
Create new accessor with same local idx and given DOF handler. Actual and given DOF handler must be c...
Field< 3, FieldValue< 3 >::Scalar > water_source_density
Field< 3, FieldValue< 3 >::Scalar > conductivity
std::vector< LocalSystem > loc_schur_
unsigned int local_idx() const
Return local index to element (index of DOF handler).
std::vector< LocalSystem > loc_system_
Following data members are stored in vectors, one item for every cell.
double compute_conductivity(const DHCellAccessor &cell, BulkPoint &p) override
BCField< 3, FieldValue< 3 >::Scalar > bc_switch_pressure
void initialize(ElementCacheMap *element_cache_map)
Initialize auxiliary vectors and other data members.
FieldResult field_result(RegionSet region_set) const override
Indicates special field states.
const ElementAccessor< 3 > elm() const
Return ElementAccessor to element of loc_ele_idx_.
void begin() override
Implements AssemblyBase::begin.
Container for various descendants of FieldCommonBase.
BCField< 3, FieldValue< 3 >::Enum > bc_type
RichardsLMH::EqFields EqFields
void initialize(ElementCacheMap *element_cache_map)
Initialize auxiliary vectors and other data members.
void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
Range< BulkPoint > bulk_points(unsigned int element_patch_idx) const
Return BulkPoint range of appropriate dimension.
void end() override
Implements AssemblyBase::end.
RichardsLMH::EqFields EqFields
MHMatrixAssemblyRichards(EqFields *eq_fields, EqData *eq_data)
unsigned int n_sides() const
Cell accessor allow iterate over DOF handler cells.
RichardsLMH::EqData EqData
std::shared_ptr< DOFHandlerMultiDim > dh_cr_disc_
DOF handler represents DOFs of sides.
void reset_soil_model(const DHCellAccessor &cell, BulkPoint &p)
int active_integrals_
Holds mask of active integrals.
static constexpr const char * name()
std::shared_ptr< Balance > balance
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > water_content_ptr
LocDofVec get_loc_dof_indices() const
Returns the local indices of dofs associated to the cell on the local process.
static constexpr const char * name()
void postprocess_bulk_integral(const DHCellAccessor &cell, unsigned int element_patch_idx) override
Field< 3, FieldValue< 3 >::Scalar > extra_storativity
double get(unsigned int pos) const
Return value on given position.
double water_content_previous_time
~MHMatrixAssemblyRichards()
Destructor.
Field< 3, FieldValue< 3 >::Scalar > storativity
~InitCondPostprocessAssembly()
Destructor.
RichardsLMH::EqFields EqFields
LocDofVec edge_indices_
Dofs of discontinuous fields on element edges.
void postprocess_velocity_specific(const DHCellAccessor &dh_cell, BulkPoint &p, arma::vec &solution, double edge_scale, double edge_source_term) override
void initialize(ElementCacheMap *element_cache_map)
Initialize auxiliary vectors and other data members.
RichardsLMH::EqData EqData
unsigned int bulk_idx() const
Returns index of the region in the bulk set.
Field< 3, FieldValue< 3 >::TensorFixed > anisotropy
Generic class of assemblation.
ElementCacheMap * element_cache_map_
ElementCacheMap shared with GenericAssembly object.
Field< 3, FieldValue< 3 >::Scalar > water_content_saturated
double measure() const
Computes the measure of the element.
void assemble_source_term(const DHCellAccessor &cell, BulkPoint &p) override
unsigned int IntDim
A dimension index type.