/*! * \brief The specific internal energy of a fluid phase [J/kg] */ Scalar internalEnergy(unsigned phaseIdx) const { return enthalpy_[phaseIdx] - asImp_().pressure(phaseIdx)/asImp_().density(phaseIdx); }
/*! * \brief The concentration of a component in a phase [mol/m^3] * * This quantity is often called "molar concentration" or just * "concentration", but there are many other (though less common) * measures for concentration. * * http://en.wikipedia.org/wiki/Concentration */ Scalar molarity(int phaseIdx, int compIdx) const { return asImp_().molarDensity(phaseIdx)*moleFraction(phaseIdx, compIdx); }
void updateAllPressures(const FluidState& fluidState) { asImp_().updateAll(fluidState, Temperature | Composition); }
/*! * \brief The concentration of a component in a phase [mol/m^3] * * This quantity is often called "molar concentration" or just * "concentration", but there are many other (though less common) * measures for concentration. * * http://en.wikipedia.org/wiki/Concentration */ Scalar molarity(unsigned phaseIdx, unsigned compIdx) const { return asImp_().molarDensity(phaseIdx)*moleFraction(phaseIdx, compIdx); }
void updateSingleMoleFraction(const FluidState& fluidState, unsigned phaseIdx, unsigned /*compIdx*/) { asImp_().updateComposition(fluidState, phaseIdx); }
void updateAll(const FluidState& fluidState, int /*exceptQuantities*/ = None) { for (unsigned phaseIdx = 0; phaseIdx < FluidState::numPhases; ++phaseIdx) asImp_().updatePhase(fluidState, phaseIdx); }
void updateComposition(const FluidState& fluidState, unsigned phaseIdx) { asImp_().updatePhase(fluidState, phaseIdx, /*except=*/Temperature | Pressure); }
void updatePressure(const FluidState& fluidState, unsigned phaseIdx) { asImp_().updatePhase(fluidState, phaseIdx); }
void updateAllTemperatures(const FluidState& fluidState) { for (unsigned phaseIdx = 0; phaseIdx < FluidState::numPhases; ++phaseIdx) asImp_().updatePhase(fluidState, phaseIdx); }
/*! * \brief The fugacity of a component in a phase [Pa] */ Scalar fugacity(unsigned phaseIdx, unsigned compIdx) const { return asImp_().pressure(phaseIdx)*fugacityCoefficient_[phaseIdx][compIdx]*asImp_().moleFraction(phaseIdx, compIdx); }
/*! * \brief The molar density of a fluid phase [mol/m^3] */ Scalar molarDensity(unsigned phaseIdx) const { return density_[phaseIdx]/asImp_().averageMolarMass(phaseIdx); }