Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120653227
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
Sun, Jul 6, 00:31
Size
1 KB
Mime Type
text/x-c
Expires
Tue, Jul 8, 00:31 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27222657
Attached To
rSPECMICP SpecMiCP / ReactMiCP
variables.cpp
View Options
#include "variables.hpp"
namespace specmicp {
namespace reactmicp {
namespace systems {
namespace siasaturated {
void SIASaturatedVariables::update_composition(index_t node, const 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 (index_t 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);
}
scalar_t SIASaturatedVariables::immobile_total_amount(index_t node, index_t component)
{
return (m_data->nu_mineral.col(component).array()*
m_speciation_variables.block(m_data->nb_component, node, m_data->nb_mineral, 1).array()).sum();
}
void SIASaturatedVariables::nodal_update_total_amount(index_t node, Vector& total_amount)
{
total_amount.resize(m_data->nb_component);
total_amount(0) = mass_water(node)/m_data->molar_mass_basis_si(0)+immobile_total_amount(node, 0);
for (index_t component: m_data->range_aqueous_component())
{
total_amount(component) = nodal_component_update_total_amount(node, component);
}
}
scalar_t SIASaturatedVariables::nodal_component_update_total_amount(index_t node, index_t component)
{
return mass_water(node)*total_mobile_concentration(node,component)+immobile_total_amount(node, component);
}
scalar_t SIASaturatedVariables::mass_water(index_t node)
{
return m_param->density_water()*m_param->porosity(node)*m_mesh->cell_volume(node)*1e-3;
}
} // end namespace siasaturated
} // end namespace systems
} // end namespace reactmicp
} // end namespace specmicp
Event Timeline
Log In to Comment