multiphaseEuler::cellPressureCorrector: Use constrainH rather than constrainHbyA
This commit is contained in:
@ -168,37 +168,32 @@ void Foam::solvers::multiphaseEuler::cellPressureCorrector()
|
|||||||
const volScalarField& alpha = phase;
|
const volScalarField& alpha = phase;
|
||||||
const label phasei = phase.index();
|
const label phasei = phase.index();
|
||||||
|
|
||||||
HbyAs.set
|
const volVectorField H
|
||||||
(
|
(
|
||||||
phasei,
|
constrainH
|
||||||
constrainHbyA
|
|
||||||
(
|
(
|
||||||
rAUs[phasei]
|
|
||||||
*(
|
|
||||||
UEqns[phasei].H()
|
UEqns[phasei].H()
|
||||||
+ byDt
|
+ byDt
|
||||||
(
|
(
|
||||||
max(phase.residualAlpha() - alpha, scalar(0))
|
max(phase.residualAlpha() - alpha, scalar(0))
|
||||||
*phase.rho()
|
*phase.rho()
|
||||||
)
|
)
|
||||||
*phase.U()().oldTime()
|
*phase.U()().oldTime(),
|
||||||
),
|
rAUs[phasei],
|
||||||
phase.U(),
|
phase.U(),
|
||||||
p_rgh
|
p_rgh
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
HbyAs.set(phasei, rAUs[phasei]*H);
|
||||||
|
|
||||||
phiHbyAs.set
|
phiHbyAs.set
|
||||||
(
|
(
|
||||||
phasei,
|
phasei,
|
||||||
new surfaceScalarField
|
new surfaceScalarField
|
||||||
(
|
(
|
||||||
IOobject::groupName("phiHbyA", phase.name()),
|
IOobject::groupName("phiHbyA", phase.name()),
|
||||||
rAUfs[phasei]
|
rAUfs[phasei]*(fvc::flux(H) + ddtCorrs[phasei])
|
||||||
*(
|
|
||||||
fvc::flux(HbyAs[phasei]/rAUs[phasei])
|
|
||||||
+ ddtCorrs[phasei]
|
|
||||||
)
|
|
||||||
- alpharAUfs[phasei]*phigFs[phasei]
|
- alpharAUfs[phasei]*phigFs[phasei]
|
||||||
- rAUfs[phasei]*Fs[phasei]
|
- rAUfs[phasei]*Fs[phasei]
|
||||||
)
|
)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -75,6 +75,52 @@ Foam::tmp<Foam::volVectorField> Foam::constrainHbyA
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::volVectorField> Foam::constrainH
|
||||||
|
(
|
||||||
|
const tmp<volVectorField>& tH,
|
||||||
|
const volScalarField& rA,
|
||||||
|
const volVectorField& U,
|
||||||
|
const volScalarField& p
|
||||||
|
)
|
||||||
|
{
|
||||||
|
tmp<volVectorField> tHNew;
|
||||||
|
|
||||||
|
if (tH.isTmp())
|
||||||
|
{
|
||||||
|
tHNew = tH;
|
||||||
|
tHNew.ref().rename(IOobject::groupName("H", U.group()));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tHNew = volVectorField::New
|
||||||
|
(
|
||||||
|
IOobject::groupName("H", U.group()),
|
||||||
|
tH
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
volVectorField& H = tHNew.ref();
|
||||||
|
volVectorField::Boundary& Hbf = H.boundaryFieldRef();
|
||||||
|
|
||||||
|
forAll(U.boundaryField(), patchi)
|
||||||
|
{
|
||||||
|
if
|
||||||
|
(
|
||||||
|
!U.boundaryField()[patchi].assignable()
|
||||||
|
&& !isA<fixedFluxExtrapolatedPressureFvPatchScalarField>
|
||||||
|
(
|
||||||
|
p.boundaryField()[patchi]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Hbf[patchi] = U.boundaryField()[patchi]/rA.boundaryField()[patchi];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tHNew;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::surfaceScalarField> Foam::constrainPhiHbyA
|
Foam::tmp<Foam::surfaceScalarField> Foam::constrainPhiHbyA
|
||||||
(
|
(
|
||||||
const tmp<surfaceScalarField>& tphiHbyA,
|
const tmp<surfaceScalarField>& tphiHbyA,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -51,6 +51,14 @@ tmp<volVectorField> constrainHbyA
|
|||||||
const volScalarField& p
|
const volScalarField& p
|
||||||
);
|
);
|
||||||
|
|
||||||
|
tmp<volVectorField> constrainH
|
||||||
|
(
|
||||||
|
const tmp<volVectorField>& tH,
|
||||||
|
const volScalarField& rA,
|
||||||
|
const volVectorField& U,
|
||||||
|
const volScalarField& p
|
||||||
|
);
|
||||||
|
|
||||||
tmp<surfaceScalarField> constrainPhiHbyA
|
tmp<surfaceScalarField> constrainPhiHbyA
|
||||||
(
|
(
|
||||||
const tmp<surfaceScalarField>& tphiHbyA,
|
const tmp<surfaceScalarField>& tphiHbyA,
|
||||||
|
|||||||
Reference in New Issue
Block a user