Mass Density
MassDensity is a thin per-phase density storage. It records an initial mass-density value for each active phase and exposes a Set method that builds the spatial density field from the current phase fractions and the current composition/temperature, for any downstream module that needs
Key Classes and Concepts
MassDensity : public OPObject: holdsInitial[alpha]per phase and aTotalspatial field populated bySet(PhaseField&, Composition&, Temperature&).
Usage
Input
Defined in the @MassDensity block. One value is required per active phase, keyed by zero-based phase index.
text
@MassDensity
$Rho0_0 Initial mass density, phase 0 [kg/m^3] : 7850
$Rho0_1 Initial mass density, phase 1 [kg/m^3] : 7000Output
No dedicated output file. The spatial density is consumed by whichever module needs it.
Example
cpp
#include "MassDensity.h"
MassDensity Rho(OPSettings, InputFile);
for(RTC.tStep = RTC.tStart; RTC.tStep <= RTC.nSteps; RTC.IncrementTimeStep())
{
// ... phase-field update, composition update, heat update ...
Rho.Set(Phi, Cx, Tx);
// Rho.Total is now the current ρ(x); downstream modules can read it.
}Dependencies
- PhaseField — supplies
. - Composition — supplies
. - Temperature — supplies
. - Settings.