mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Rewrite of ddtPhiCorr - ddtCorr and density-weight HbyA on compressible solvers.
For DyM solvers phiAbs is replaced by Uf but this conversion is currently not complete
This commit is contained in:
@ -12,16 +12,16 @@
|
||||
surfaceScalarField rhof("rhof", fvc::interpolate(rho));
|
||||
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rAUf("Dp", rhof*fvc::interpolate(rAU));
|
||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
|
||||
phiv = (fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU, rho, U, phivAbs);
|
||||
+ Dp*fvc::ddtCorr(U, phivAbs);
|
||||
fvc::makeRelative(phiv, U);
|
||||
|
||||
surfaceScalarField phiGradp(rAUf*mesh.magSf()*fvc::snGrad(p));
|
||||
surfaceScalarField phiGradp(Dp*mesh.magSf()*fvc::snGrad(p));
|
||||
|
||||
phiv -= phiGradp/rhof;
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
+ psi*correction(fvm::ddt(p))
|
||||
+ fvc::div(phiv, rho)
|
||||
+ fvc::div(phiGradp)
|
||||
- fvm::laplacian(rAUf, p)
|
||||
- fvm::laplacian(Dp, p)
|
||||
);
|
||||
|
||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||
|
||||
@ -12,15 +12,15 @@
|
||||
surfaceScalarField rhof("rhof", fvc::interpolate(rho));
|
||||
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rAUf("Dp", rhof*fvc::interpolate(rAU));
|
||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
|
||||
phiv = (fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU, rho, U, phiv);
|
||||
+ Dp*fvc::ddtCorr(U, phiv);
|
||||
|
||||
surfaceScalarField phiGradp(rAUf*mesh.magSf()*fvc::snGrad(p));
|
||||
surfaceScalarField phiGradp(Dp*mesh.magSf()*fvc::snGrad(p));
|
||||
|
||||
phiv -= phiGradp/rhof;
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
- (rhol0 + (psil - psiv)*pSat)*fvc::ddt(alphav) - pSat*fvc::ddt(psi)
|
||||
+ fvc::div(phiv, rho)
|
||||
+ fvc::div(phiGradp)
|
||||
- fvm::laplacian(rAUf, p)
|
||||
- fvm::laplacian(Dp, p)
|
||||
);
|
||||
|
||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
|
||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
@ -9,7 +9,7 @@
|
||||
(
|
||||
"phiHbyA",
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
||||
);
|
||||
phi = phiHbyA;
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rAUf*mesh.magSf()
|
||||
)*Dp*mesh.magSf()
|
||||
);
|
||||
|
||||
phiHbyA += phig;
|
||||
@ -70,7 +70,7 @@
|
||||
fvScalarMatrix p_rghEqnIncomp
|
||||
(
|
||||
fvc::div(phiHbyA)
|
||||
- fvm::laplacian(rAUf, p_rgh)
|
||||
- fvm::laplacian(Dp, p_rgh)
|
||||
);
|
||||
|
||||
solve
|
||||
@ -97,7 +97,7 @@
|
||||
phi = phiHbyA + p_rghEqnIncomp.flux();
|
||||
|
||||
U = HbyA
|
||||
+ rAU*fvc::reconstruct((phig + p_rghEqnIncomp.flux())/rAUf);
|
||||
+ rAU*fvc::reconstruct((phig + p_rghEqnIncomp.flux())/Dp);
|
||||
U.correctBoundaryConditions();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
|
||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
@ -9,7 +9,7 @@
|
||||
(
|
||||
"phiHbyA",
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
||||
);
|
||||
adjustPhi(phiHbyA, U, p_rgh);
|
||||
mrfZones.makeRelative(phiHbyA);
|
||||
@ -20,7 +20,7 @@
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rAUf*mesh.magSf()
|
||||
)*Dp*mesh.magSf()
|
||||
);
|
||||
|
||||
phiHbyA += phig;
|
||||
@ -29,7 +29,7 @@
|
||||
{
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
|
||||
fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA)
|
||||
);
|
||||
|
||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||
@ -40,7 +40,7 @@
|
||||
{
|
||||
phi = phiHbyA - p_rghEqn.flux();
|
||||
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp);
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
|
||||
@ -1,20 +1,27 @@
|
||||
if (mesh.changing())
|
||||
{
|
||||
#include "continuityErrs.H"
|
||||
|
||||
wordList pcorrTypes
|
||||
(
|
||||
p_rgh.boundaryField().size(),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
forAll (p_rgh.boundaryField(), i)
|
||||
forAll(U.boundaryField(), patchI)
|
||||
{
|
||||
if (p_rgh.boundaryField()[i].fixesValue())
|
||||
if (U.boundaryField()[patchI].fixesValue())
|
||||
{
|
||||
pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
|
||||
U.boundaryField()[patchI].initEvaluate();
|
||||
}
|
||||
}
|
||||
|
||||
forAll(U.boundaryField(), patchI)
|
||||
{
|
||||
if (U.boundaryField()[patchI].fixesValue())
|
||||
{
|
||||
U.boundaryField()[patchI].evaluate();
|
||||
|
||||
phi.boundaryField()[patchI] =
|
||||
U.boundaryField()[patchI]
|
||||
& mesh.Sf().boundaryField()[patchI];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
volScalarField pcorr
|
||||
(
|
||||
IOobject
|
||||
@ -30,17 +37,13 @@
|
||||
pcorrTypes
|
||||
);
|
||||
|
||||
dimensionedScalar rAUf("(1|A(U))", dimTime/rho.dimensions(), 1.0);
|
||||
|
||||
adjustPhi(phi, U, pcorr);
|
||||
|
||||
fvc::makeAbsolute(phi, U);
|
||||
dimensionedScalar Dp("Dp", dimTime/rho.dimensions(), 1.0);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pcorrEqn
|
||||
(
|
||||
fvm::laplacian(rAUf, pcorr) == fvc::div(phi)
|
||||
fvm::laplacian(Dp, pcorr) == fvc::div(phi)
|
||||
);
|
||||
|
||||
pcorrEqn.setReference(pRefCell, pRefValue);
|
||||
@ -49,9 +52,6 @@
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi -= pcorrEqn.flux();
|
||||
phiAbs = phi;
|
||||
phiAbs.oldTime() = phi;
|
||||
fvc::makeRelative(phi, U);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
wordList pcorrTypes
|
||||
(
|
||||
p_rgh.boundaryField().size(),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
for (label i=0; i<p_rgh.boundaryField().size(); i++)
|
||||
{
|
||||
if (p_rgh.boundaryField()[i].fixesValue())
|
||||
{
|
||||
pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Global
|
||||
createUf
|
||||
|
||||
Description
|
||||
Creates and initialises the velocity velocity field Uf.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef createUf_H
|
||||
#define createUf_H
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "Reading/calculating face velocity Uf\n" << endl;
|
||||
|
||||
surfaceVectorField Uf
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Uf",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
linearInterpolate(U)
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -50,15 +50,13 @@ int main(int argc, char *argv[])
|
||||
#include "createTime.H"
|
||||
#include "createDynamicFvMesh.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createFields.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
#include "createFields.H"
|
||||
#include "createUf.H"
|
||||
#include "readTimeControls.H"
|
||||
|
||||
surfaceScalarField phiAbs("phiAbs", phi);
|
||||
fvc::makeAbsolute(phiAbs, U);
|
||||
|
||||
#include "createPcorrTypes.H"
|
||||
#include "correctPhi.H"
|
||||
#include "CourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
@ -80,21 +78,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
||||
|
||||
{
|
||||
// Ensure old-time U exists for mapping
|
||||
U.oldTime();
|
||||
|
||||
// Calculate the relative velocity used to map the relative flux phi
|
||||
volVectorField Urel("Urel", U);
|
||||
|
||||
if (mesh.moving())
|
||||
{
|
||||
Urel -= fvc::reconstruct(fvc::meshPhi(U));
|
||||
}
|
||||
|
||||
// Do any mesh changes
|
||||
mesh.update();
|
||||
}
|
||||
mesh.update();
|
||||
|
||||
if (mesh.changing())
|
||||
{
|
||||
@ -108,7 +92,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (mesh.changing() && correctPhi)
|
||||
{
|
||||
// Calculate absolute flux from the mapped surface velocity
|
||||
phi = mesh.Sf() & Uf;
|
||||
|
||||
#include "correctPhi.H"
|
||||
|
||||
// Make the flux relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
}
|
||||
|
||||
if (mesh.changing() && checkMeshCourantNo)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
|
||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
@ -9,7 +9,7 @@
|
||||
(
|
||||
"phiHbyA",
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU, rho, U, phiAbs)
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, Uf)
|
||||
);
|
||||
|
||||
if (p_rgh.needReference())
|
||||
@ -19,14 +19,14 @@
|
||||
fvc::makeAbsolute(phiHbyA, U);
|
||||
}
|
||||
|
||||
phiAbs = phiHbyA;
|
||||
surfaceScalarField phiAbs("phiAbs", phiHbyA);
|
||||
|
||||
surfaceScalarField phig
|
||||
(
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rAUf*mesh.magSf()
|
||||
)*Dp*mesh.magSf()
|
||||
);
|
||||
|
||||
phiHbyA += phig;
|
||||
@ -35,7 +35,7 @@
|
||||
{
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
|
||||
fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA)
|
||||
);
|
||||
|
||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||
@ -46,7 +46,7 @@
|
||||
{
|
||||
phi = phiHbyA - p_rghEqn.flux();
|
||||
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp);
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
@ -54,7 +54,11 @@
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
phiAbs = phi;
|
||||
{
|
||||
Uf = fvc::interpolate(U);
|
||||
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||
Uf += mesh.Sf()*(phi - (mesh.Sf() & Uf))/sqr(mesh.magSf());
|
||||
}
|
||||
|
||||
// Make the fluxes relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
|
||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
@ -9,7 +9,7 @@
|
||||
(
|
||||
"phiHbyA",
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
||||
);
|
||||
|
||||
adjustPhi(phiHbyA, U, p_rgh);
|
||||
@ -20,7 +20,7 @@
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rAUf*mesh.magSf()
|
||||
)*Dp*mesh.magSf()
|
||||
);
|
||||
|
||||
phiHbyA += phig;
|
||||
@ -29,7 +29,7 @@
|
||||
{
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
|
||||
fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA)
|
||||
);
|
||||
|
||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||
@ -40,7 +40,7 @@
|
||||
{
|
||||
phi = phiHbyA - p_rghEqn.flux();
|
||||
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp);
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
|
||||
@ -60,14 +60,13 @@ int main(int argc, char *argv[])
|
||||
#include "createDynamicFvMesh.H"
|
||||
#include "readGravitationalAcceleration.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createFields.H"
|
||||
#include "readTimeControls.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
surfaceScalarField phiAbs("phiAbs", phi);
|
||||
fvc::makeAbsolute(phiAbs, U);
|
||||
|
||||
#include "createFields.H"
|
||||
#include "../interFoam/interDyMFoam/createUf.H"
|
||||
#include "readTimeControls.H"
|
||||
#include "../interFoam/interDyMFoam/createPcorrTypes.H"
|
||||
#include "../interFoam/interDyMFoam/correctPhi.H"
|
||||
#include "CourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
@ -88,21 +87,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
||||
|
||||
{
|
||||
// Ensure old-time U exists for mapping
|
||||
U.oldTime();
|
||||
|
||||
// Calculate the relative velocity used to map the relative flux phi
|
||||
volVectorField Urel("Urel", U);
|
||||
|
||||
if (mesh.moving())
|
||||
{
|
||||
Urel -= fvc::reconstruct(fvc::meshPhi(U));
|
||||
}
|
||||
|
||||
// Do any mesh changes
|
||||
mesh.update();
|
||||
}
|
||||
mesh.update();
|
||||
|
||||
if (mesh.changing())
|
||||
{
|
||||
@ -116,7 +101,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (mesh.changing() && correctPhi)
|
||||
{
|
||||
// Calculate absolute flux from the mapped surface velocity
|
||||
phi = mesh.Sf() & Uf;
|
||||
|
||||
#include "../interFoam/interDyMFoam/correctPhi.H"
|
||||
|
||||
// Make the flux relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
}
|
||||
|
||||
if (mesh.changing() && checkMeshCourantNo)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
|
||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
@ -9,7 +9,7 @@
|
||||
(
|
||||
"phiHbyA",
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU, rho, U, phiAbs)
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, Uf)
|
||||
);
|
||||
|
||||
if (p_rgh.needReference())
|
||||
@ -19,14 +19,14 @@
|
||||
fvc::makeAbsolute(phiHbyA, U);
|
||||
}
|
||||
|
||||
phiAbs = phiHbyA;
|
||||
surfaceScalarField phiAbs("phiAbs", phiHbyA);
|
||||
|
||||
surfaceScalarField phig
|
||||
(
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rAUf*mesh.magSf()
|
||||
)*Dp*mesh.magSf()
|
||||
);
|
||||
|
||||
phiHbyA += phig;
|
||||
@ -39,7 +39,7 @@
|
||||
{
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
fvc::div(phiHbyA) - fvm::laplacian(rAUf, p_rgh)
|
||||
fvc::div(phiHbyA) - fvm::laplacian(Dp, p_rgh)
|
||||
- (vDotvP - vDotcP)*(pSat - rho*gh) + fvm::Sp(vDotvP - vDotcP, p_rgh)
|
||||
);
|
||||
|
||||
@ -51,13 +51,17 @@
|
||||
{
|
||||
phi = phiHbyA + p_rghEqn.flux();
|
||||
|
||||
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf);
|
||||
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/Dp);
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
}
|
||||
|
||||
phiAbs = phi;
|
||||
{
|
||||
Uf = fvc::interpolate(U);
|
||||
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||
Uf += mesh.Sf()*(phi - (mesh.Sf() & Uf))/sqr(mesh.magSf());
|
||||
}
|
||||
|
||||
// Make the fluxes relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
|
||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
@ -9,7 +9,7 @@
|
||||
(
|
||||
"phiHbyA",
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
||||
);
|
||||
adjustPhi(phiHbyA, U, p_rgh);
|
||||
phi = phiHbyA;
|
||||
@ -19,7 +19,7 @@
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rAUf*mesh.magSf()
|
||||
)*Dp*mesh.magSf()
|
||||
);
|
||||
|
||||
phiHbyA += phig;
|
||||
@ -32,7 +32,7 @@
|
||||
{
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
fvc::div(phiHbyA) - fvm::laplacian(rAUf, p_rgh)
|
||||
fvc::div(phiHbyA) - fvm::laplacian(Dp, p_rgh)
|
||||
- (vDotvP - vDotcP)*(pSat - rho*gh) + fvm::Sp(vDotvP - vDotcP, p_rgh)
|
||||
);
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
{
|
||||
phi = phiHbyA + p_rghEqn.flux();
|
||||
|
||||
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf);
|
||||
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/Dp);
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@
|
||||
phiHbyAs[phasei] =
|
||||
(
|
||||
(fvc::interpolate(HbyAs[phasei]) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAUs[phasei], alpha, phase.U(), phase.phi())
|
||||
+ rAlphaAUfs[phasei]*fvc::ddtCorr(phase.U(), phase.phi())
|
||||
);
|
||||
mrfZones.makeRelative(phiHbyAs[phasei]);
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
|
||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
@ -9,7 +9,7 @@
|
||||
(
|
||||
"phiHbyA",
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
||||
);
|
||||
adjustPhi(phiHbyA, U, p_rgh);
|
||||
mrfZones.makeRelative(phiHbyA);
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
surfaceScalarField phig
|
||||
(
|
||||
- ghf*fvc::snGrad(rho)*rAUf*mesh.magSf()
|
||||
- ghf*fvc::snGrad(rho)*Dp*mesh.magSf()
|
||||
);
|
||||
|
||||
phiHbyA += phig;
|
||||
@ -26,7 +26,7 @@
|
||||
{
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
|
||||
fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA)
|
||||
);
|
||||
|
||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||
@ -37,7 +37,7 @@
|
||||
{
|
||||
phi = phiHbyA - p_rghEqn.flux();
|
||||
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp);
|
||||
U.correctBoundaryConditions();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
|
||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
@ -9,7 +9,7 @@
|
||||
(
|
||||
"phiHbyA",
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
||||
);
|
||||
adjustPhi(phiHbyA, U, p_rgh);
|
||||
phi = phiHbyA;
|
||||
@ -19,7 +19,7 @@
|
||||
(
|
||||
mixture.surfaceTensionForce()
|
||||
- ghf*fvc::snGrad(rho)
|
||||
)*rAUf*mesh.magSf()
|
||||
)*Dp*mesh.magSf()
|
||||
);
|
||||
|
||||
phiHbyA += phig;
|
||||
@ -28,7 +28,7 @@
|
||||
{
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
|
||||
fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA)
|
||||
);
|
||||
|
||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||
@ -39,7 +39,7 @@
|
||||
{
|
||||
phi = phiHbyA - p_rghEqn.flux();
|
||||
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp);
|
||||
U.correctBoundaryConditions();
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU, U, phi)
|
||||
+ rAUf*fvc::ddtCorr(U, phi)
|
||||
);
|
||||
|
||||
adjustPhi(phiHbyA, U, p_gh);
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
|
||||
surfaceScalarField rAUf("Dp", fvc::interpolate(rho*rAU));
|
||||
surfaceScalarField Dp("Dp", fvc::interpolate(rho*rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
@ -9,17 +8,16 @@
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
fvc::interpolate(rho)
|
||||
*(
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
||||
(
|
||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||
+ Dp*fvc::ddtCorr(rho, U, phi)
|
||||
)
|
||||
);
|
||||
phi = phiHbyA;
|
||||
|
||||
surfaceScalarField phig
|
||||
(
|
||||
- ghf*fvc::snGrad(rho)*rAUf*mesh.magSf()
|
||||
- ghf*fvc::snGrad(rho)*Dp*mesh.magSf()
|
||||
);
|
||||
|
||||
phiHbyA += phig;
|
||||
@ -28,7 +26,7 @@
|
||||
{
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
fvm::laplacian(rAUf, p_rgh) == fvc::ddt(rho) + fvc::div(phiHbyA)
|
||||
fvm::laplacian(Dp, p_rgh) == fvc::ddt(rho) + fvc::div(phiHbyA)
|
||||
);
|
||||
|
||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||
@ -39,7 +37,7 @@
|
||||
{
|
||||
phi = phiHbyA - p_rghEqn.flux();
|
||||
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp);
|
||||
U.correctBoundaryConditions();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
|
||||
surfaceScalarField Dp("Dp", fvc::interpolate(rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
@ -9,14 +9,14 @@
|
||||
(
|
||||
"phiHbyA",
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
|
||||
);
|
||||
adjustPhi(phiHbyA, U, p_rgh);
|
||||
phi = phiHbyA;
|
||||
|
||||
surfaceScalarField phig
|
||||
(
|
||||
- ghf*fvc::snGrad(rho)*rAUf*mesh.magSf()
|
||||
- ghf*fvc::snGrad(rho)*Dp*mesh.magSf()
|
||||
);
|
||||
|
||||
phiHbyA += phig;
|
||||
@ -25,7 +25,7 @@
|
||||
{
|
||||
fvScalarMatrix p_rghEqn
|
||||
(
|
||||
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
|
||||
fvm::laplacian(Dp, p_rgh) == fvc::div(phiHbyA)
|
||||
);
|
||||
|
||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||
@ -36,7 +36,7 @@
|
||||
{
|
||||
phi = phiHbyA - p_rghEqn.flux();
|
||||
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
|
||||
U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/Dp);
|
||||
U.correctBoundaryConditions();
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,14 +47,14 @@
|
||||
(
|
||||
IOobject::groupName("phiHbyA", phase1.name()),
|
||||
(fvc::interpolate(HbyA1) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU1, alpha1, U1, phi1)
|
||||
+ rAlphaAU1f*fvc::ddtCorr(U1, phi1)
|
||||
);
|
||||
|
||||
surfaceScalarField phiHbyA2
|
||||
(
|
||||
IOobject::groupName("phiHbyA", phase2.name()),
|
||||
(fvc::interpolate(HbyA2) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU2, alpha2, U2, phi2)
|
||||
+ rAlphaAU2f*fvc::ddtCorr(U2, phi2)
|
||||
);
|
||||
|
||||
phiHbyA1 +=
|
||||
|
||||
Reference in New Issue
Block a user