Commit 037e3bdc authored by Beatrix Becker's avatar Beatrix Becker
Browse files

[compositionalflash] only set both mass/mole fractions if necessary

parent 58412316
......@@ -188,13 +188,10 @@ public:
fluidState.setPresentPhaseIdx(presentPhaseIdx);
fluidState.setMassFraction(presentPhaseIdx,comp0Idx, Z0);
fluidState.setMassFraction(presentPhaseIdx,comp1Idx, 1. - Z0);
// transform mass to mole fractions
fluidState.setMoleFraction(presentPhaseIdx, comp0Idx, Z0 / FluidSystem::molarMass(comp0Idx)
/ (Z0 / FluidSystem::molarMass(comp0Idx) + (1. - Z0) / FluidSystem::molarMass(comp1Idx)));
fluidState.setMoleFraction(presentPhaseIdx, comp1Idx, (1. - Z0) / FluidSystem::molarMass(comp1Idx)
/ (Z0 / FluidSystem::molarMass(comp0Idx) + (1. - Z0) / FluidSystem::molarMass(comp1Idx)));
fluidState.setAverageMolarMass(presentPhaseIdx,
fluidState.massFraction(presentPhaseIdx, comp0Idx) * FluidSystem::molarMass(comp0Idx)
......
Supports Markdown
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