diff --git a/ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/DarcyLaw.h b/ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/DarcyLaw.h index fc64acaa541..b5c09bede41 100644 --- a/ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/DarcyLaw.h +++ b/ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/DarcyLaw.h @@ -13,6 +13,7 @@ #include "LiquidDensity.h" #include "LiquidViscosity.h" #include "PermeabilityData.h" +#include "SpecificBodyForceData.h" #include "ThermoOsmosis.h" namespace ProcessLib::ThermoRichardsMechanics @@ -47,6 +48,12 @@ struct DarcyLawModel ThermoOsmosisData const& th_osmosis_data, DarcyLawData& out) const; + static DarcyLawModel create( + SpecificBodyForceData const& specific_body_force_data) + { + return DarcyLawModel{specific_body_force_data.specific_body_force}; + } + private: /// Gravity vector (specific body force). Eigen::Vector const b_; diff --git a/ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/EqP.h b/ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/EqP.h index 6b4d4192069..6c782cfc9e5 100644 --- a/ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/EqP.h +++ b/ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/EqP.h @@ -16,6 +16,7 @@ #include "LiquidViscosity.h" #include "PermeabilityData.h" #include "Saturation.h" +#include "SpecificBodyForceData.h" #include "TRMStorage.h" #include "TRMVaporDiffusion.h" @@ -59,6 +60,12 @@ struct EqPModel TRMStorageData const& storage_data, EqPData& out) const; + static EqPModel create( + SpecificBodyForceData const& specific_body_force_data) + { + return EqPModel{specific_body_force_data.specific_body_force}; + } + private: /// Gravity vector (specific body force). Eigen::Vector const b_; diff --git a/ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/Gravity.h b/ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/Gravity.h index b2567998b7a..b121d18a39f 100644 --- a/ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/Gravity.h +++ b/ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/Gravity.h @@ -13,6 +13,7 @@ #include "LiquidDensity.h" #include "Saturation.h" #include "SolidDensity.h" +#include "SpecificBodyForceData.h" namespace ProcessLib::ThermoRichardsMechanics { @@ -39,6 +40,12 @@ struct GravityModel SaturationDataDeriv const& dS_L_data, GravityData& out) const; + static GravityModel create( + SpecificBodyForceData const& specific_body_force_data) + { + return GravityModel{specific_body_force_data.specific_body_force}; + } + private: Eigen::Vector const specific_body_force_; }; diff --git a/ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/SpecificBodyForceData.h b/ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/SpecificBodyForceData.h new file mode 100644 index 00000000000..52a97e9019c --- /dev/null +++ b/ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/SpecificBodyForceData.h @@ -0,0 +1,21 @@ +/** + * \file + * \copyright + * Copyright (c) 2012-2024, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + */ + +#pragma once + +#include + +namespace ProcessLib::ThermoRichardsMechanics +{ +template +struct SpecificBodyForceData +{ + Eigen::Vector specific_body_force; +}; +} // namespace ProcessLib::ThermoRichardsMechanics diff --git a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStressSaturation_StrainPressureTemperature/ConstitutiveData.h b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStressSaturation_StrainPressureTemperature/ConstitutiveData.h index e47149cb92e..d419d433165 100644 --- a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStressSaturation_StrainPressureTemperature/ConstitutiveData.h +++ b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStressSaturation_StrainPressureTemperature/ConstitutiveData.h @@ -16,6 +16,7 @@ #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/EqT.h" #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/EquivalentPlasticStrainData.h" #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/Gravity.h" +#include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/LiquidViscosity.h" #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/Porosity.h" #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/Saturation.h" #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/SolidDensity.h" diff --git a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStressSaturation_StrainPressureTemperature/ConstitutiveModels.h b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStressSaturation_StrainPressureTemperature/ConstitutiveModels.h index 49c65fa0e4b..44170724b22 100644 --- a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStressSaturation_StrainPressureTemperature/ConstitutiveModels.h +++ b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStressSaturation_StrainPressureTemperature/ConstitutiveModels.h @@ -10,6 +10,7 @@ #pragma once +#include "ProcessLib/Graph/ConstructModels.h" #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/DarcyLaw.h" #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/EqP.h" #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/EqT.h" @@ -60,32 +61,11 @@ ConstitutiveModels createConstitutiveModels( TRMProcessData const& process_data, SolidConstitutiveRelation const& solid_material) { - return { - {}, - SolidMechanicsModel{solid_material}, - SolidCompressibilityModel>{ - solid_material}, - {}, - {}, - {}, - - {}, - {}, - GravityModel{process_data.specific_body_force}, - {}, - {}, - {}, - {}, - DarcyLawModel{process_data.specific_body_force}, - {}, - {}, - - {}, - {}, - {}, - EqPModel{process_data.specific_body_force}, - {}}; + return ProcessLib::Graph::constructModels< + ConstitutiveModels>( + SpecificBodyForceData{ + process_data.specific_body_force}, + solid_material); } } // namespace ConstitutiveStressSaturation_StrainPressureTemperature diff --git a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStressSaturation_StrainPressureTemperature/SolidCompressibilityModel.h b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStressSaturation_StrainPressureTemperature/SolidCompressibilityModel.h index c5f2a204280..0fd177ff58b 100644 --- a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStressSaturation_StrainPressureTemperature/SolidCompressibilityModel.h +++ b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStressSaturation_StrainPressureTemperature/SolidCompressibilityModel.h @@ -18,6 +18,7 @@ namespace ProcessLib::ThermoRichardsMechanics { namespace ConstitutiveStressSaturation_StrainPressureTemperature { +// TODO remove typename SolidMaterial template struct SolidCompressibilityModel { @@ -38,6 +39,11 @@ struct SolidCompressibilityModel x_t.t, x_t.x, &s_mech_data_stateless.stiffness_tensor); } + static SolidCompressibilityModel create(SolidMaterial const& solid_material) + { + return SolidCompressibilityModel{solid_material}; + } + private: SolidMaterial const& solid_material_; }; diff --git a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStressSaturation_StrainPressureTemperature/SolidMechanics.h b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStressSaturation_StrainPressureTemperature/SolidMechanics.h index 2abd44e50e3..334d27effeb 100644 --- a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStressSaturation_StrainPressureTemperature/SolidMechanics.h +++ b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStressSaturation_StrainPressureTemperature/SolidMechanics.h @@ -47,6 +47,12 @@ struct SolidMechanicsModel PrevState const& S_L_prev_data, SaturationData& S_L_data, SaturationDataDeriv& dS_L_data) const; + static SolidMechanicsModel create( + SolidConstitutiveRelation const& solid_material) + { + return SolidMechanicsModel{solid_material}; + } + private: SolidConstitutiveRelation const& solid_material_; diff --git a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/ConstitutiveData.h b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/ConstitutiveData.h index 2b417113aba..0ea905b8ee5 100644 --- a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/ConstitutiveData.h +++ b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/ConstitutiveData.h @@ -16,6 +16,7 @@ #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/EqT.h" #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/EquivalentPlasticStrainData.h" #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/Gravity.h" +#include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/LiquidViscosity.h" #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/Porosity.h" #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/Saturation.h" #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/SolidDensity.h" diff --git a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/ConstitutiveModels.h b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/ConstitutiveModels.h index 52e970cf195..bbba7bffb5d 100644 --- a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/ConstitutiveModels.h +++ b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/ConstitutiveModels.h @@ -11,6 +11,7 @@ #pragma once #include "ElasticTangentStiffnessModel.h" +#include "ProcessLib/Graph/ConstructModels.h" #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/DarcyLaw.h" #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/EqP.h" #include "ProcessLib/ThermoRichardsMechanics/ConstitutiveCommon/EqT.h" @@ -65,36 +66,11 @@ ConstitutiveModels createConstitutiveModels( TRMProcessData const& process_data, SolidConstitutiveRelation const& solid_material) { - return { - ElasticTangentStiffnessModel{solid_material}, - {} /* BiotModel */, - SolidCompressibilityModel>{ - solid_material}, - {} /* SaturationModel */, - {} /* BishopsModel */, - {} /* BishopsPrevModel */, - {} /* PorosityModel */, - - {} /* SwellingModel */, - {} /* SolidThermalExpansionModel */, - SolidMechanicsModel{solid_material}, - {} /* LiquidDensityModel */, - - {} /* SolidDensityModel */, - GravityModel{process_data.specific_body_force}, - {} /* LiquidViscosityModel */, - {} /* TransportPorosityModel */, - {} /* PermeabilityModel */, - {} /* ThermoOsmosisModel */, - DarcyLawModel{process_data.specific_body_force}, - {} /* TRMHeatStorageAndFluxModel */, - {} /* TRMVaporDiffusionModel */, - {} /* FluidThermalExpansionModel */, - {} /* TRMStorageModel */, - EqPModel{process_data.specific_body_force}, - {} /* EqTModel */ - }; + return ProcessLib::Graph::constructModels< + ConstitutiveModels>( + SpecificBodyForceData{ + process_data.specific_body_force}, + solid_material); } } // namespace ConstitutiveStress_StrainTemperature } // namespace ProcessLib::ThermoRichardsMechanics diff --git a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/ElasticTangentStiffnessModel.h b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/ElasticTangentStiffnessModel.h index 63922ed9fde..e697d859edf 100644 --- a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/ElasticTangentStiffnessModel.h +++ b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/ElasticTangentStiffnessModel.h @@ -31,6 +31,12 @@ struct ElasticTangentStiffnessModel TemperatureData const& T_data, ElasticTangentStiffnessData& out) const; + static ElasticTangentStiffnessModel create( + SolidConstitutiveRelation const& solid_material) + { + return ElasticTangentStiffnessModel{solid_material}; + } + private: SolidConstitutiveRelation const& solid_material_; }; diff --git a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/SolidCompressibilityModel.h b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/SolidCompressibilityModel.h index c4566a5cce3..ac98ccf44af 100644 --- a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/SolidCompressibilityModel.h +++ b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/SolidCompressibilityModel.h @@ -18,6 +18,7 @@ namespace ProcessLib::ThermoRichardsMechanics { namespace ConstitutiveStress_StrainTemperature { +// TODO remove typename SolidMaterial template struct SolidCompressibilityModel { @@ -35,6 +36,11 @@ struct SolidCompressibilityModel x_t.t, x_t.x, &C_el_data.C_el); } + static SolidCompressibilityModel create(SolidMaterial const& solid_material) + { + return SolidCompressibilityModel{solid_material}; + } + private: SolidMaterial const& solid_material_; }; diff --git a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/SolidMechanics.h b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/SolidMechanics.h index 908f052ec8f..ceb8d3ebbb1 100644 --- a/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/SolidMechanics.h +++ b/ProcessLib/ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/SolidMechanics.h @@ -76,6 +76,12 @@ struct SolidMechanicsModel return solid_material_.getInternalVariables(); } + static SolidMechanicsModel create( + SolidConstitutiveRelation const& solid_material) + { + return SolidMechanicsModel{solid_material}; + } + private: SolidConstitutiveRelation const& solid_material_; };