Skip to content
Snippets Groups Projects
Commit 8a98c48a authored by Tom Fischer's avatar Tom Fischer
Browse files

[PL/HT] Use FluidProperties.

FluidProperties is a process independent container
for common fluid properties like density, viscosity
and specific heat capacity.
parent 5bead473
No related branches found
No related tags found
No related merge requests found
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
#include "CreateHTProcess.h" #include "CreateHTProcess.h"
#include "MaterialLib/Fluid/Density/CreateFluidDensityModel.h" #include "MaterialLib/Fluid/FluidProperties/CreateFluidProperties.h"
#include "MaterialLib/Fluid/Viscosity/CreateViscosityModel.h"
#include "ProcessLib/Parameter/ConstantParameter.h" #include "ProcessLib/Parameter/ConstantParameter.h"
#include "ProcessLib/Utils/ParseSecondaryVariables.h" #include "ProcessLib/Utils/ParseSecondaryVariables.h"
...@@ -58,22 +57,8 @@ std::unique_ptr<Process> createHTProcess( ...@@ -58,22 +57,8 @@ std::unique_ptr<Process> createHTProcess(
//! \ogs_file_param{prj__processes__process__HT__fluid} //! \ogs_file_param{prj__processes__process__HT__fluid}
auto const& fluid_config = config.getConfigSubtree("fluid"); auto const& fluid_config = config.getConfigSubtree("fluid");
//! \ogs_file_param{prj__processes__process__HT__fluid__viscosity} auto fluid_properties =
auto const& viscosity_conf = fluid_config.getConfigSubtree("viscosity"); MaterialLib::Fluid::createFluidProperties(fluid_config);
auto viscosity_model =
MaterialLib::Fluid::createViscosityModel(viscosity_conf);
// Parameter for the density of the solid.
auto& density_solid = findParameter<double>(
config,
//! \ogs_file_param_special{prj__processes__process__HT__density_solid}
"density_solid", parameters, 1);
DBUG("Use \'%s\' as density_solid parameter.", density_solid.name.c_str());
//! \ogs_file_param{prj__processes__process__HT__fluid__density}
auto const& fluid_density_conf = fluid_config.getConfigSubtree("density");
auto fluid_density =
MaterialLib::Fluid::createFluidDensityModel(fluid_density_conf);
// Parameter for the density of the fluid. // Parameter for the density of the fluid.
auto& fluid_reference_density= findParameter<double>( auto& fluid_reference_density= findParameter<double>(
...@@ -83,6 +68,13 @@ std::unique_ptr<Process> createHTProcess( ...@@ -83,6 +68,13 @@ std::unique_ptr<Process> createHTProcess(
DBUG("Use \'%s\' as fluid_reference_density parameter.", DBUG("Use \'%s\' as fluid_reference_density parameter.",
fluid_reference_density.name.c_str()); fluid_reference_density.name.c_str());
// Parameter for the density of the solid.
auto& density_solid = findParameter<double>(
config,
//! \ogs_file_param_special{prj__processes__process__HT__density_solid}
"density_solid", parameters, 1);
DBUG("Use \'%s\' as density_solid parameter.", density_solid.name.c_str());
// Parameter for the specific heat capacity of the solid. // Parameter for the specific heat capacity of the solid.
auto& specific_heat_capacity_solid = findParameter<double>( auto& specific_heat_capacity_solid = findParameter<double>(
config, config,
...@@ -91,14 +83,6 @@ std::unique_ptr<Process> createHTProcess( ...@@ -91,14 +83,6 @@ std::unique_ptr<Process> createHTProcess(
DBUG("Use \'%s\' as specific_heat_capacity_solid parameter.", DBUG("Use \'%s\' as specific_heat_capacity_solid parameter.",
specific_heat_capacity_solid.name.c_str()); specific_heat_capacity_solid.name.c_str());
// Parameter for the specific heat capacity of the fluid.
auto& specific_heat_capacity_fluid = findParameter<double>(
config,
//! \ogs_file_param_special{prj__processes__process__HT__specific_heat_capacity_fluid}
"specific_heat_capacity_fluid", parameters, 1);
DBUG("Use \'%s\' as specific_heat_capacity_fluid parameter.",
specific_heat_capacity_fluid.name.c_str());
// Parameter for the thermal conductivity of the solid (only one scalar per // Parameter for the thermal conductivity of the solid (only one scalar per
// element, i.e., the isotropic case is handled at the moment) // element, i.e., the isotropic case is handled at the moment)
auto& thermal_dispersivity_longitudinal = findParameter<double>( auto& thermal_dispersivity_longitudinal = findParameter<double>(
...@@ -152,20 +136,17 @@ std::unique_ptr<Process> createHTProcess( ...@@ -152,20 +136,17 @@ std::unique_ptr<Process> createHTProcess(
std::copy_n(b.data(), b.size(), specific_body_force.data()); std::copy_n(b.data(), b.size(), specific_body_force.data());
} }
HTProcessData process_data{ HTProcessData process_data{std::move(porous_media_properties),
std::move(porous_media_properties), density_solid,
std::move(viscosity_model), fluid_reference_density,
density_solid, std::move(fluid_properties),
fluid_reference_density, thermal_dispersivity_longitudinal,
std::move(fluid_density), thermal_dispersivity_transversal,
thermal_dispersivity_longitudinal, specific_heat_capacity_solid,
thermal_dispersivity_transversal, thermal_conductivity_solid,
specific_heat_capacity_solid, thermal_conductivity_fluid,
specific_heat_capacity_fluid, specific_body_force,
thermal_conductivity_solid, has_gravity};
thermal_conductivity_fluid,
specific_body_force,
has_gravity};
SecondaryVariableCollection secondary_variables; SecondaryVariableCollection secondary_variables;
......
...@@ -194,8 +194,14 @@ public: ...@@ -194,8 +194,14 @@ public:
auto const specific_heat_capacity_solid = auto const specific_heat_capacity_solid =
_process_data.specific_heat_capacity_solid(t, pos)[0]; _process_data.specific_heat_capacity_solid(t, pos)[0];
vars[static_cast<int>(
MaterialLib::Fluid::PropertyVariableType::T)] = T_int_pt;
vars[static_cast<int>(
MaterialLib::Fluid::PropertyVariableType::p)] = p_int_pt;
auto const specific_heat_capacity_fluid = auto const specific_heat_capacity_fluid =
_process_data.specific_heat_capacity_fluid(t, pos)[0]; _process_data.fluid_properties->getValue(
MaterialLib::Fluid::FluidPropertyType::HeatCapacity, vars);
auto const thermal_dispersivity_longitudinal = auto const thermal_dispersivity_longitudinal =
_process_data.thermal_dispersivity_longitudinal(t, pos)[0]; _process_data.thermal_dispersivity_longitudinal(t, pos)[0];
...@@ -211,16 +217,14 @@ public: ...@@ -211,16 +217,14 @@ public:
auto Bp = local_b.template block<num_nodes, 1>(num_nodes, 0); auto Bp = local_b.template block<num_nodes, 1>(num_nodes, 0);
// Use the fluid density model to compute the density // Use the fluid density model to compute the density
vars[static_cast<int>(
MaterialLib::Fluid::PropertyVariableType::T)] = T_int_pt;
vars[static_cast<int>(
MaterialLib::Fluid::PropertyVariableType::p)] = p_int_pt;
auto const density_water_T = auto const density_water_T =
_process_data.fluid_density->getValue(vars); _process_data.fluid_properties->getValue(
MaterialLib::Fluid::FluidPropertyType::Density, vars);
// Use the viscosity model to compute the viscosity // Use the viscosity model to compute the viscosity
auto const viscosity = auto const viscosity =
_process_data.viscosity_model->getValue(vars); _process_data.fluid_properties->getValue(
MaterialLib::Fluid::FluidPropertyType::Viscosity, vars);
GlobalDimMatrixType perm_over_visc = GlobalDimMatrixType perm_over_visc =
intrinsic_permeability / viscosity; intrinsic_permeability / viscosity;
......
...@@ -12,10 +12,7 @@ ...@@ -12,10 +12,7 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
#include "MaterialLib/Fluid/FluidProperty.h" #include "MaterialLib/Fluid/FluidProperties/FluidProperties.h"
#include "MaterialLib/PorousMedium/Porosity/Porosity.h"
#include "MaterialLib/PorousMedium/Storage/Storage.h"
#include "PorousMediaProperties.h" #include "PorousMediaProperties.h"
namespace ProcessLib namespace ProcessLib
...@@ -29,25 +26,22 @@ struct HTProcessData ...@@ -29,25 +26,22 @@ struct HTProcessData
{ {
HTProcessData( HTProcessData(
PorousMediaProperties&& porous_media_properties_, PorousMediaProperties&& porous_media_properties_,
std::unique_ptr<MaterialLib::Fluid::FluidProperty>&& viscosity_model_,
ProcessLib::Parameter<double> const& density_solid_, ProcessLib::Parameter<double> const& density_solid_,
ProcessLib::Parameter<double> const& fluid_reference_density_, ProcessLib::Parameter<double> const& fluid_reference_density_,
std::unique_ptr<MaterialLib::Fluid::FluidProperty>&& fluid_density_, std::unique_ptr<MaterialLib::Fluid::FluidProperties>&&
fluid_properties_,
ProcessLib::Parameter<double> const& thermal_dispersivity_longitudinal_, ProcessLib::Parameter<double> const& thermal_dispersivity_longitudinal_,
ProcessLib::Parameter<double> const& thermal_dispersivity_transversal_, ProcessLib::Parameter<double> const& thermal_dispersivity_transversal_,
ProcessLib::Parameter<double> const& specific_heat_capacity_solid_, ProcessLib::Parameter<double> const& specific_heat_capacity_solid_,
ProcessLib::Parameter<double> const& specific_heat_capacity_fluid_,
ProcessLib::Parameter<double> const& thermal_conductivity_solid_, ProcessLib::Parameter<double> const& thermal_conductivity_solid_,
ProcessLib::Parameter<double> const& thermal_conductivity_fluid_, ProcessLib::Parameter<double> const& thermal_conductivity_fluid_,
Eigen::VectorXd specific_body_force_, Eigen::VectorXd specific_body_force_,
bool const has_gravity_) bool const has_gravity_)
: porous_media_properties(std::move(porous_media_properties_)), : porous_media_properties(std::move(porous_media_properties_)),
viscosity_model(std::move(viscosity_model_)),
density_solid(density_solid_), density_solid(density_solid_),
fluid_reference_density(fluid_reference_density_), fluid_reference_density(fluid_reference_density_),
fluid_density(std::move(fluid_density_)), fluid_properties(std::move(fluid_properties_)),
specific_heat_capacity_solid(specific_heat_capacity_solid_), specific_heat_capacity_solid(specific_heat_capacity_solid_),
specific_heat_capacity_fluid(specific_heat_capacity_fluid_),
thermal_dispersivity_longitudinal(thermal_dispersivity_longitudinal_), thermal_dispersivity_longitudinal(thermal_dispersivity_longitudinal_),
thermal_dispersivity_transversal(thermal_dispersivity_transversal_), thermal_dispersivity_transversal(thermal_dispersivity_transversal_),
thermal_conductivity_solid(thermal_conductivity_solid_), thermal_conductivity_solid(thermal_conductivity_solid_),
...@@ -59,12 +53,10 @@ struct HTProcessData ...@@ -59,12 +53,10 @@ struct HTProcessData
HTProcessData(HTProcessData&& other) HTProcessData(HTProcessData&& other)
: porous_media_properties(std::move(other.porous_media_properties)), : porous_media_properties(std::move(other.porous_media_properties)),
viscosity_model(other.viscosity_model.release()),
density_solid(other.density_solid), density_solid(other.density_solid),
fluid_reference_density(other.fluid_reference_density), fluid_reference_density(other.fluid_reference_density),
fluid_density(other.fluid_density.release()), fluid_properties(other.fluid_properties.release()),
specific_heat_capacity_solid(other.specific_heat_capacity_solid), specific_heat_capacity_solid(other.specific_heat_capacity_solid),
specific_heat_capacity_fluid(other.specific_heat_capacity_fluid),
thermal_dispersivity_longitudinal( thermal_dispersivity_longitudinal(
other.thermal_dispersivity_longitudinal), other.thermal_dispersivity_longitudinal),
thermal_dispersivity_transversal( thermal_dispersivity_transversal(
...@@ -86,12 +78,10 @@ struct HTProcessData ...@@ -86,12 +78,10 @@ struct HTProcessData
void operator=(HTProcessData&&) = delete; void operator=(HTProcessData&&) = delete;
PorousMediaProperties porous_media_properties; PorousMediaProperties porous_media_properties;
std::unique_ptr<MaterialLib::Fluid::FluidProperty> viscosity_model;
Parameter<double> const& density_solid; Parameter<double> const& density_solid;
Parameter<double> const& fluid_reference_density; Parameter<double> const& fluid_reference_density;
std::unique_ptr<MaterialLib::Fluid::FluidProperty> fluid_density; std::unique_ptr<MaterialLib::Fluid::FluidProperties> fluid_properties;
Parameter<double> const& specific_heat_capacity_solid; Parameter<double> const& specific_heat_capacity_solid;
Parameter<double> const& specific_heat_capacity_fluid;
Parameter<double> const& thermal_dispersivity_longitudinal; Parameter<double> const& thermal_dispersivity_longitudinal;
Parameter<double> const& thermal_dispersivity_transversal; Parameter<double> const& thermal_dispersivity_transversal;
Parameter<double> const& thermal_conductivity_solid; Parameter<double> const& thermal_conductivity_solid;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment