Changes in solutionControl::reconstructTransientVelocity

The function now takes care of making the flux relative if the mesh is moving.
This is necessary in order to consistently reconstruct the face velocity from
the flux and then call correctBoundaryConditions on U.
This commit is contained in:
Vuko Vukcevic 2017-01-04 16:22:27 +01:00
parent cd4c08fedc
commit 4031066a5a
3 changed files with 13 additions and 7 deletions

View file

@ -119,7 +119,7 @@ int main(int argc, char *argv[])
# include "continuityErrs.H"
// Consistently reconstruct velocity after pressure equation
piso.reconstructTransientVelocity(U, ddtUEqn, rAU, p, phi);
piso.reconstructTransientVelocity(U, phi, ddtUEqn, rAU, p);
}
runTime.write();

View file

@ -529,10 +529,10 @@ void Foam::solutionControl::calcSteadyConsistentFlux
void Foam::solutionControl::reconstructTransientVelocity
(
volVectorField& U,
surfaceScalarField& phi,
const fvVectorMatrix& ddtUEqn,
const volScalarField& rAU,
const volScalarField& p,
const surfaceScalarField& phi
const volScalarField& p
) const
{
// Reconstruct the velocity using all the components from original equation
@ -540,10 +540,9 @@ void Foam::solutionControl::reconstructTransientVelocity
(
U/rAU + ddtUEqn.H() - fvc::grad(p)
);
U.correctBoundaryConditions();
// Update divergence free face velocity field, whose value will be used in
// the next time step
// the next time step. Note that we need to have absolute flux here.
if (!faceUPtr_)
{
FatalErrorIn
@ -576,6 +575,13 @@ void Foam::solutionControl::reconstructTransientVelocity
// Now that the normal component is zero, add the normal component from
// conservative flux
faceU += phi*rSf;
// If the mesh is moving, flux needs to be relative before boundary
// conditions for velocity are corrected. VV and IG, 4/Jan/2016.
fvc::makeRelative(phi, U);
// Correct boundary conditions with relative flux
U.correctBoundaryConditions();
}

View file

@ -286,10 +286,10 @@ public:
void reconstructTransientVelocity
(
volVectorField& U,
surfaceScalarField& phi,
const fvVectorMatrix& ddtUEqn,
const volScalarField& rAU,
const volScalarField& p,
const surfaceScalarField& phi
const volScalarField& p
) const;
//- Reconstruct velocity for steady state solvers (after pressure