23 std::unique_ptr<AbstractJacobianAssembler>&& jacobian_assembler,
24 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
25 unsigned const integration_order,
26 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
30 :
Process(std::move(
name), mesh, std::move(jacobian_assembler), parameters,
31 integration_order, std::move(process_variables),
32 std::move(secondary_variables))
34 DBUG(
"Create TESProcess.");
38 std::vector<std::pair<std::string, double*>> params{
40 {
"fluid_specific_heat_source",
45 {
"solid_specific_heat_source",
54 {
"diffusion_coefficient",
63 for (
auto const& p : params)
69 DBUG(
"setting parameter `{:s}' to value `{:g}'", p.first, *par);
77 std::vector<std::pair<std::string, Trafo*>>
const params{
85 for (
auto const& p : params)
91 INFO(
"setting parameter `{:s}' to value `{:g}'", p.first, *par);
92 *p.second =
Trafo{*par};
101 "solid_hydraulic_permeability"))
104 "setting parameter `solid_hydraulic_permeability' to isotropic "
109 Eigen::MatrixXd::Identity(dim, dim) * (*par);
118 if (
auto const param =
122 DBUG(
"output_element_matrices: {:s}", (*param) ?
"true" :
"false");
142 unsigned const integration_order)
144 const int monolithic_process_id = 0;
147 ProcessLib::createLocalAssemblers<TESLocalAssembler>(
164 [&](
unsigned const n_components,
167 std::vector<GlobalVector*>
const& ,
170 std::vector<double>& )
177 add2nd(
"solid_density",
180 add2nd(
"reaction_rate",
183 add2nd(
"darcy_velocity",
189 "reaction_damping_factor",
192 add2nd(
"vapour_partial_pressure",
198 add2nd(
"relative_humidity",
204 add2nd(
"equilibrium_loading",
213 std::vector<GlobalVector*>
const& x,
214 std::vector<GlobalVector*>
const& xdot,
218 DBUG(
"Assemble TESProcess.");
220 std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>>
232 const double t,
double const dt, std::vector<GlobalVector*>
const& x,
233 std::vector<GlobalVector*>
const& xdot,
const double dxdot_dx,
237 std::vector<std::reference_wrapper<NumLib::LocalToGlobalIndexMap>>
245 dxdot_dx, dx_dx, process_id, M, K, b, Jac);
250 const double delta_t,
251 const int process_id)
253 DBUG(
"new timestep");
274 bool check_passed =
true;
281 std::vector<GlobalIndexType> indices_cache;
282 std::vector<double> local_x_cache;
283 std::vector<double> local_x_prev_ts_cache;
287 auto check_variable_bounds =
292 local_x_cache = x.
get(r_c_indices.rows);
295 if (!loc_asm.checkBounds(local_x_cache, local_x_prev_ts_cache))
297 check_passed =
false;
311 DBUG(
"ts {:d} iteration {:d} (in current ts: {:d}) try {:d} accepted",
323 std::vector<GlobalVector*>
const& x,
324 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_table,
325 std::unique_ptr<GlobalVector>& result_cache)
327 constexpr
int process_id = 0;
332 {dof_table_single.dofSizeWithoutGhosts(),
333 dof_table_single.dofSizeWithoutGhosts(),
334 &dof_table_single.getGhostIndices(),
nullptr});
350 result_cache->set(node_id, p * x_nV);
353 return *result_cache;
358 std::vector<GlobalVector*>
const& xs,
359 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_table,
360 std::unique_ptr<GlobalVector>& result_cache)
362 constexpr
int process_id = 0;
367 {dof_table_single.dofSizeWithoutGhosts(),
368 dof_table_single.dofSizeWithoutGhosts(),
369 &dof_table_single.getGhostIndices(),
nullptr});
373 auto const& x = *xs[0];
390 result_cache->set(node_id, p * x_nV / p_S);
393 return *result_cache;
398 std::vector<GlobalVector*>
const& xs,
399 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& dof_table,
400 std::unique_ptr<GlobalVector>& result_cache)
402 constexpr
int process_id = 0;
407 {dof_table_single.dofSizeWithoutGhosts(),
408 dof_table_single.dofSizeWithoutGhosts(),
409 &dof_table_single.getGhostIndices(),
nullptr});
413 auto const& x = *xs[0];
427 auto const p_V = p * x_nV;
433 result_cache->set(node_id, C_eq);
436 return *result_cache;
GlobalMatrix::IndexType GlobalIndexType
void INFO(char const *fmt, Args const &... args)
void DBUG(char const *fmt, Args const &... args)
static double getMolarFraction(double xm, double M_this, double M_other)
static double getEquilibriumVapourPressure(const double T_Ads)
static std::unique_ptr< Reaction > newInstance(BaseLib::ConfigTree const &conf)
std::optional< T > getConfigParameterOptional(std::string const ¶m) const
ConfigTree getConfigSubtree(std::string const &root) const
Global vector based on Eigen vector.
double get(IndexType rowId) const
get entry
bool isAxiallySymmetric() const
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
std::size_t getNumberOfNodes() const
Get the number of nodes.
unsigned getShapeFunctionOrder() const
std::vector< std::size_t > const & getActiveElementIDs() const
NumLib::Extrapolator & getExtrapolator() const
NumLib::LocalToGlobalIndexMap const & getSingleComponentDOFTable() const
SecondaryVariableCollection _secondary_variables
std::vector< std::reference_wrapper< ProcessVariable > > const & getProcessVariables(const int process_id) const
VectorMatrixAssembler _global_assembler
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map
Handles configuration of several secondary variables from the project file.
void addSecondaryVariable(std::string const &internal_name, SecondaryVariableFunctions &&fcts)
virtual std::vector< double > const & getIntPtLoading(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtDarcyVelocity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtReactionRate(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtReactionDampingFactor(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
virtual std::vector< double > const & getIntPtSolidDensity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const =0
std::vector< std::unique_ptr< TESLocalAssemblerInterface > > _local_assemblers
void initializeSecondaryVariables()
GlobalVector const & computeRelativeHumidity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::unique_ptr< GlobalVector > &result_cache)
TESProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const ¶meters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable >>> &&process_variables, SecondaryVariableCollection &&secondary_variables, BaseLib::ConfigTree const &config)
void preTimestepConcreteProcess(std::vector< GlobalVector * > const &x, const double t, const double delta_t, const int process_id) override
void assembleConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b) override
NumLib::IterationResult postIterationConcreteProcess(GlobalVector const &x) override
std::unique_ptr< GlobalVector > _x_previous_timestep
GlobalVector const & computeEquilibriumLoading(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::unique_ptr< GlobalVector > &result_cache)
GlobalVector const & computeVapourPartialPressure(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::unique_ptr< GlobalVector > &result_cache)
void initializeConcreteProcess(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order) override
Process specific initialization called by initialize().
void preIterationConcreteProcess(const unsigned iter, GlobalVector const &x) override
AssemblyParams _assembly_params
void assembleWithJacobianConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, const double dxdot_dx, const double dx_dx, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b, GlobalMatrix &Jac) override
void assembleWithJacobian(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< std::reference_wrapper< NumLib::LocalToGlobalIndexMap >> const &dof_tables, const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, const double dxdot_dx, const double dx_dx, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b, GlobalMatrix &Jac)
void assemble(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< std::reference_wrapper< NumLib::LocalToGlobalIndexMap >> const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b)
IterationResult
Status flags telling the NonlinearSolver if an iteration succeeded.
void setLocalAccessibleVector(PETScVector const &x)
double getNodalValue(GlobalVector const &x, MeshLib::Mesh const &mesh, NumLib::LocalToGlobalIndexMap const &dof_table, std::size_t const node_id, std::size_t const global_component_id)
NumLib::LocalToGlobalIndexMap::RowColumnIndices getRowColumnIndices(std::size_t const id, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< GlobalIndexType > &indices)
const unsigned COMPONENT_ID_MASS_FRACTION
const unsigned COMPONENT_ID_TEMPERATURE
const unsigned COMPONENT_ID_PRESSURE
SecondaryVariableFunctions makeExtrapolator(const unsigned num_components, NumLib::Extrapolator &extrapolator, LocalAssemblerCollection const &local_assemblers, typename NumLib::ExtrapolatableLocalAssemblerCollection< LocalAssemblerCollection >::IntegrationPointValuesMethod integration_point_values_method)
static void executeSelectedMemberDereferenced(Object &object, Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
static void executeDereferenced(F const &f, C const &c, Args_ &&... args)
std::size_t timestep
Output global matrix/rhs after first iteration.
bool output_element_matrices
double diffusion_coefficient_component
unsigned number_of_try_of_iteration
Eigen::MatrixXd solid_perm_tensor
double solid_specific_heat_source
std::size_t total_iteration
std::unique_ptr< Adsorption::Reaction > react_sys
double fluid_specific_heat_source
unsigned iteration_in_current_timestep
double initial_solid_density
static const bool constrained