Consistent velocity reconstruction with moving meshes. Vuko Vukcevic

This commit is contained in:
Hrvoje Jasak 2019-07-11 14:48:12 +01:00
commit 52072b3296

View file

@ -1019,11 +1019,18 @@ void Foam::solutionControl::reconstructTransientVelocity
const volScalarField& p const volScalarField& p
) const ) const
{ {
// 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);
// Reconstruct the velocity using all the components from original equation // Reconstruct the velocity using all the components from original equation
U = 1.0/(1.0/rAU + ddtUEqn.A())* U = 1.0/(1.0/rAU + ddtUEqn.A())*
( (
U/rAU + ddtUEqn.H() - fvc::grad(p) U/rAU + ddtUEqn.H() - fvc::grad(p)
); );
// Correct boundary conditions with relative flux
U.correctBoundaryConditions();
// Get name and the corresponding index // Get name and the corresponding index
const word& UName = U.name(); const word& UName = U.name();
@ -1067,13 +1074,6 @@ void Foam::solutionControl::reconstructTransientVelocity
// Now that the normal component is zero, add the normal component from // Now that the normal component is zero, add the normal component from
// conservative flux // conservative flux
faceU += phi*rSf; 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();
} }