Skip to content
Snippets Groups Projects
Commit a88d0e71 authored by sergio's avatar sergio
Browse files

BUG: Fixing BC's fixed value for species in multicomponent system

parent 851cf11c
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017-2020 OpenCFD Ltd. Copyright (C) 2017-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -90,7 +90,9 @@ MultiComponentPhaseModel ...@@ -90,7 +90,9 @@ MultiComponentPhaseModel
( (
IOobject::groupName("X" + species_[i], phaseName), IOobject::groupName("X" + species_[i], phaseName),
fluid.mesh().time().timeName(), fluid.mesh().time().timeName(),
fluid.mesh() fluid.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
), ),
Y()[i] Y()[i]
) )
...@@ -116,7 +118,7 @@ void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo> ...@@ -116,7 +118,7 @@ void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>
{ {
const dimensionedScalar Wi const dimensionedScalar Wi
( (
"W", "Wi",
dimMass/dimMoles, dimMass/dimMoles,
thermo().composition().W(i) thermo().composition().W(i)
); );
...@@ -126,6 +128,23 @@ void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo> ...@@ -126,6 +128,23 @@ void Foam::MultiComponentPhaseModel<BasePhaseModel, phaseThermo>
X_[i] = W*Y()[i]/Wi; X_[i] = W*Y()[i]/Wi;
Xtotal += X_[i]; Xtotal += X_[i];
X_[i].correctBoundaryConditions(); 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; X_[inertIndex_] = 1.0 - Xtotal;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment