Commit ced14117 authored by renchao.lu's avatar renchao.lu
Browse files

[CL] Add class member volume_fraction.

parent f989cda1
......@@ -39,11 +39,13 @@ void ChemicalSystem::initialize(std::size_t const num_chemical_systems)
for (auto& kinetic_reactant : kinetic_reactants)
{
kinetic_reactant.molality->resize(num_chemical_systems);
kinetic_reactant.volume_fraction->resize(num_chemical_systems);
}
for (auto& equilibrium_reactant : equilibrium_reactants)
{
equilibrium_reactant.molality->resize(num_chemical_systems);
equilibrium_reactant.volume_fraction->resize(num_chemical_systems);
}
}
} // namespace PhreeqcIOData
......
......@@ -46,12 +46,15 @@ std::vector<EquilibriumReactant> createEquilibriumReactants(
auto molality = MeshLib::getOrCreateMeshProperty<double>(
mesh, name, MeshLib::MeshItemType::IntegrationPoint, 1);
auto volume_fraction = MeshLib::getOrCreateMeshProperty<double>(
mesh, "phi_" + name, MeshLib::MeshItemType::IntegrationPoint, 1);
auto mesh_prop_molality = MeshLib::getOrCreateMeshProperty<double>(
mesh, name + "_avg", MeshLib::MeshItemType::Cell, 1);
mesh_prop_molality->resize(mesh.getNumberOfElements());
equilibrium_reactants.emplace_back(
std::move(name), molality, mesh_prop_molality, saturation_index);
std::move(name), molality, volume_fraction, mesh_prop_molality, saturation_index);
}
return equilibrium_reactants;
......
......@@ -54,6 +54,9 @@ std::vector<KineticReactant> createKineticReactants(
auto molality = MeshLib::getOrCreateMeshProperty<double>(
mesh, name, MeshLib::MeshItemType::IntegrationPoint, 1);
auto volume_fraction = MeshLib::getOrCreateMeshProperty<double>(
mesh, "phi_" + name, MeshLib::MeshItemType::IntegrationPoint, 1);
auto mesh_prop_molality = MeshLib::getOrCreateMeshProperty<double>(
mesh, name + "_avg", MeshLib::MeshItemType::Cell, 1);
mesh_prop_molality->resize(mesh.getNumberOfElements());
......@@ -68,6 +71,7 @@ std::vector<KineticReactant> createKineticReactants(
kinetic_reactants.emplace_back(std::move(name),
std::move(chemical_formula),
molality,
volume_fraction,
mesh_prop_molality,
std::move(parameters),
fix_amount);
......
......@@ -30,10 +30,12 @@ struct EquilibriumReactant
{
EquilibriumReactant(std::string name_,
MeshLib::PropertyVector<double>* molality_,
MeshLib::PropertyVector<double>* volume_fraction_,
MeshLib::PropertyVector<double>* mesh_prop_molality_,
double saturation_index_)
: name(std::move(name_)),
molality(molality_),
volume_fraction(volume_fraction_),
mesh_prop_molality(mesh_prop_molality_),
saturation_index(saturation_index_)
{
......@@ -43,6 +45,7 @@ struct EquilibriumReactant
std::string const name;
MeshLib::PropertyVector<double>* molality;
MeshLib::PropertyVector<double>* volume_fraction;
MeshLib::PropertyVector<double>* mesh_prop_molality;
double const saturation_index;
static const ItemType item_type = ItemType::EquilibriumReactant;
......
......@@ -27,12 +27,14 @@ struct KineticReactant
KineticReactant(std::string name_,
std::string chemical_formula_,
MeshLib::PropertyVector<double>* molality_,
MeshLib::PropertyVector<double>* volume_fraction_,
MeshLib::PropertyVector<double>* mesh_prop_molality_,
std::vector<double>&& parameters_,
bool const fix_amount_)
: name(std::move(name_)),
chemical_formula(std::move(chemical_formula_)),
molality(molality_),
volume_fraction(volume_fraction_),
mesh_prop_molality(mesh_prop_molality_),
parameters(std::move(parameters_)),
fix_amount(fix_amount_)
......@@ -44,6 +46,7 @@ struct KineticReactant
std::string const name;
std::string const chemical_formula;
MeshLib::PropertyVector<double>* molality;
MeshLib::PropertyVector<double>* volume_fraction;
MeshLib::PropertyVector<double>* mesh_prop_molality;
std::vector<double> const parameters;
bool const fix_amount;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment