Skip to content
Snippets Groups Projects
Commit 3b7daad4 authored by Yonghui56's avatar Yonghui56
Browse files

directly pass fluid properties rather than fluid density&viscosity

parent e592d7ec
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@
#include "BaseLib/reorderVector.h"
#include "MaterialLib/Fluid/FluidProperty.h"
#include "MaterialLib/Fluid/FluidProperties/CreateFluidProperties.h"
#include "MaterialLib/PorousMedium/Porosity/Porosity.h"
#include "MaterialLib/PorousMedium/Storage/Storage.h"
#include "MaterialLib/PorousMedium/UnsaturatedProperty/CapillaryPressure/CapillaryPressureSaturation.h"
......@@ -41,15 +42,8 @@ createRichardsFlowMaterialProperties(
//! \ogs_file_param{prj__processes__process__RICHARDS_FLOW__material_property__fluid}
auto const& fluid_config = config.getConfigSubtree("fluid");
// Get fluid properties
//! \ogs_file_param{prj__processes__process__RICHARDS_FLOW__material_property__fluid_density}
auto const& rho_conf = fluid_config.getConfigSubtree("fluid_density");
auto fluid_density = MaterialLib::Fluid::createFluidDensityModel(rho_conf);
//! \ogs_file_param{prj__processes__process__RICHARDS_FLOW__material_property__fluid_viscosity}
auto const& mu_conf = fluid_config.getConfigSubtree("fluid_viscosity");
auto fluid_viscosity = MaterialLib::Fluid::createViscosityModel(mu_conf);
auto fluid_properties =
MaterialLib::Fluid::createFluidProperties(fluid_config);
// Get porous properties
std::vector<int> mat_ids;
......@@ -112,7 +106,7 @@ createRichardsFlowMaterialProperties(
return std::unique_ptr<RichardsFlowMaterialProperties>{
new RichardsFlowMaterialProperties{
material_ids, std::move(fluid_density), std::move(fluid_viscosity),
material_ids, std::move(fluid_properties),
std::move(intrinsic_permeability_models),
std::move(porosity_models), std::move(storage_models),
std::move(capillary_pressure_models),
......
......@@ -31,8 +31,7 @@ namespace RichardsFlow
{
RichardsFlowMaterialProperties::RichardsFlowMaterialProperties(
boost::optional<MeshLib::PropertyVector<int> const&> const material_ids,
std::unique_ptr<MaterialLib::Fluid::FluidProperty>&& fluid_density,
std::unique_ptr<MaterialLib::Fluid::FluidProperty>&& fluid_viscosity,
std::unique_ptr<MaterialLib::Fluid::FluidProperties>&& fluid_properties,
std::vector<Eigen::MatrixXd>&& intrinsic_permeability_models,
std::vector<std::unique_ptr<MaterialLib::PorousMedium::Porosity>>&&
porosity_models,
......@@ -45,8 +44,7 @@ RichardsFlowMaterialProperties::RichardsFlowMaterialProperties(
std::unique_ptr<MaterialLib::PorousMedium::RelativePermeability>>&&
relative_permeability_models)
: _material_ids(material_ids),
_fluid_density(std::move(fluid_density)),
_fluid_viscosity(std::move(fluid_viscosity)),
_fluid_properties(std::move(fluid_properties)),
_intrinsic_permeability_models(intrinsic_permeability_models),
_porosity_models(std::move(porosity_models)),
_storage_models(std::move(storage_models)),
......@@ -73,7 +71,8 @@ double RichardsFlowMaterialProperties::getFluidDensity(const double p,
ArrayType vars;
vars[static_cast<int>(MaterialLib::Fluid::PropertyVariableType::T)] = T;
vars[static_cast<int>(MaterialLib::Fluid::PropertyVariableType::p)] = p;
return _fluid_density->getValue(vars);
return _fluid_properties->getValue(
MaterialLib::Fluid::FluidPropertyType::Density, vars);
}
double RichardsFlowMaterialProperties::getFluidViscosity(const double p,
......@@ -82,7 +81,8 @@ double RichardsFlowMaterialProperties::getFluidViscosity(const double p,
ArrayType vars;
vars[static_cast<int>(MaterialLib::Fluid::PropertyVariableType::T)] = T;
vars[static_cast<int>(MaterialLib::Fluid::PropertyVariableType::p)] = p;
return _fluid_viscosity->getValue(vars);
return _fluid_properties->getValue(
MaterialLib::Fluid::FluidPropertyType::Viscosity, vars);
}
Eigen::MatrixXd const& RichardsFlowMaterialProperties::getPermeability(
......
......@@ -13,6 +13,7 @@
#include <vector>
#include "MaterialLib/Fluid/FluidPropertyHeaders.h"
#include "MaterialLib/Fluid/FluidProperties/FluidProperties.h"
#include "MaterialLib/PhysicalConstant.h"
#include "MaterialLib/PorousMedium/Porosity/Porosity.h"
#include "MaterialLib/PorousMedium/PorousPropertyHeaders.h"
......@@ -49,8 +50,7 @@ public:
RichardsFlowMaterialProperties(
boost::optional<MeshLib::PropertyVector<int> const&> const material_ids,
std::unique_ptr<MaterialLib::Fluid::FluidProperty>&& fluid_density,
std::unique_ptr<MaterialLib::Fluid::FluidProperty>&& fluid_viscosity,
std::unique_ptr<MaterialLib::Fluid::FluidProperties>&& fluid_properties,
std::vector<Eigen::MatrixXd>&& intrinsic_permeability_models,
std::vector<std::unique_ptr<MaterialLib::PorousMedium::Porosity>>&&
porosity_models,
......@@ -96,8 +96,8 @@ private:
*/
boost::optional<MeshLib::PropertyVector<int> const&> const _material_ids;
std::unique_ptr<MaterialLib::Fluid::FluidProperty> const _fluid_density;
std::unique_ptr<MaterialLib::Fluid::FluidProperty> const _fluid_viscosity;
const std::unique_ptr<MaterialLib::Fluid::FluidProperties>
_fluid_properties;
std::vector<Eigen::MatrixXd> const _intrinsic_permeability_models;
std::vector<std::unique_ptr<MaterialLib::PorousMedium::Porosity>> const
......
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