Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F88166468
variables.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Oct 17, 04:29
Size
1 KB
Mime Type
text/x-c
Expires
Sat, Oct 19, 04:29 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
21727870
Attached To
rSPECMICP SpecMiCP / ReactMiCP
variables.cpp
View Options
#include "variables.hpp"
namespace specmicp {
namespace reactmicp {
namespace systems {
namespace siasaturated {
void SIASaturatedVariables::update_composition(int node, EquilibriumState& composition) {
// speciation
m_speciation_variables.col(node) = composition.main_variables();
m_secondary_concentration.col(node) = composition.molality_secondary();
m_secondary_variables.col(node) = composition.activity_coefficient();
m_ionic_strength(node) = composition.ionic_strength();
// transport
for (int component: m_data->range_aqueous_component())
{
total_mobile_concentration(node, component) = composition.total_aqueous_concentration_component(component);
}
m_speciation_variables(0, node) = mass_water(node);
}
double SIASaturatedVariables::immobile_total_amount(int node, int component)
{
double sum = 0;
for (int mineral: m_data->range_mineral())
{
if (m_data->nu_mineral(mineral, component) != 0)
{
sum += m_data->nu_mineral(mineral, component)*mineral_amount(node, mineral);
}
}
return sum;
}
void SIASaturatedVariables::nodal_update_total_amount(int node, Eigen::VectorXd& total_amount)
{
total_amount.resize(m_data->nb_component);
total_amount(0) = mass_water(node)/m_data->molar_mass_basis_si(0);
for (int component: m_data->range_aqueous_component())
{
total_amount(component) = nodal_component_update_total_amount(node, component);
}
}
double SIASaturatedVariables::nodal_component_update_total_amount(int node, int component)
{
return mass_water(node)*total_mobile_concentration(node,component)+immobile_total_amount(node, component);
}
double SIASaturatedVariables::mass_water(int node)
{
return m_param->density_water()*m_param->porosity(node)*m_mesh->cell_volume(node);
}
} // end namespace siasaturated
} // end namespace systems
} // end namespace reactmicp
} // end namespace specmicp
Event Timeline
Log In to Comment