trailer |
May 31, 2021 18:24 |
Update of face fluxes in simpleFoam
Hello to all,
I am new o CFD in general and just started studying the SIMPLE algorithm (in simpleFoam).
The continuity equation for incompressible flows is:
And the momentum equation in a semi-discritezed manner is:
or alternatively
We can now write an expression for as:
To derive the pressure correction equation we must replace the into the continuity equation. Which results in:
We must also compute the face fluxes. In this case:
In simpleFOAM:
is defined as:
Code:
volScalarField rAU(1.0/UEqn.A());
Code:
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
Code:
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));
Pressure Equation as:
Code:
fvScalarMatrix pEqn
(
fvm::laplacian(rAtU(), p) == fvc::div(phiHbyA)
);
rAtU() is equal to rAU for the SIMPLE algorithm
The velocity is reconstructed as:
Code:
U = HbyA - rAtU()*fvc::grad(p);
My doubt is in the update of the fluxes.
In the code, we have :
Code:
phi = phiHbyA - pEqn.flux();
Is this equivalent to having (?):
In addition, why does the equation change in a compressible case (rhoSimpleFoam) to:
Code:
phi = phiHbyA + pEqn.flux();
Sorry in advance if this is too basic. I am still "breaking stone". I would also appreciate recommendations for literature showing how these coupling algorithms are implemented in OpenFoam
|