diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.C index 8e10cfbd39..1917b21473 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/MultiComponentPhaseModel/MultiComponentPhaseModel.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2020 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -90,7 +90,9 @@ MultiComponentPhaseModel ( IOobject::groupName("X" + species_[i], phaseName), fluid.mesh().time().timeName(), - fluid.mesh() + fluid.mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE ), Y()[i] ) @@ -116,7 +118,7 @@ void Foam::MultiComponentPhaseModel { const dimensionedScalar Wi ( - "W", + "Wi", dimMass/dimMoles, thermo().composition().W(i) ); @@ -126,6 +128,23 @@ void Foam::MultiComponentPhaseModel X_[i] = W*Y()[i]/Wi; Xtotal += X_[i]; X_[i].correctBoundaryConditions(); + + const volScalarField::Boundary& YBf = Y()[i].boundaryField(); + + forAll(YBf, patchi) + { + const fvPatchScalarField& YPf = YBf[patchi]; + if (YPf.fixesValue()) + { + scalarField& xbf = X_[i].boundaryFieldRef()[patchi]; + const scalarField& ybf = Y()[i].boundaryField()[patchi]; + const scalarField& Wbf = W.boundaryField()[patchi]; + forAll(xbf, facei) + { + xbf[facei] = Wbf[facei]*ybf[facei]/Wi.value(); + } + } + } } } X_[inertIndex_] = 1.0 - Xtotal;