cavitatingDyMFoam: Updated to use Uf in ddtCorr (Untested)

This commit is contained in:
Henry
2013-09-11 16:46:32 +01:00
parent 5dbe19b7a6
commit 6f62380b65
4 changed files with 34 additions and 36 deletions

View File

@ -47,16 +47,15 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "readThermodynamicProperties.H"
#include "readControls.H"
#include "createFields.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
surfaceScalarField phivAbs("phivAbs", phiv);
fvc::makeAbsolute(phivAbs, U);
#include "readThermodynamicProperties.H"
#include "readControls.H"
#include "createFields.H"
#include "createUf.H"
#include "createPcorrTypes.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
@ -75,18 +74,8 @@ int main(int argc, char *argv[])
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
{
// Calculate the relative velocity used to map relative flux phiv
volVectorField Urel("Urel", U);
if (mesh.moving())
{
Urel -= fvc::reconstruct(fvc::meshPhi(U));
}
// Do any mesh changes
mesh.update();
}
// Do any mesh changes
mesh.update();
if (mesh.changing())
{
@ -94,7 +83,16 @@ int main(int argc, char *argv[])
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
<< " s" << endl;
#include "correctPhi.H"
if (correctPhi)
{
// Calculate absolute flux from the mapped surface velocity
phiv = mesh.Sf() & Uf;
#include "correctPhi.H"
// Make the flux relative to the mesh motion
fvc::makeRelative(phiv, U);
}
}
// --- Pressure-velocity PIMPLE corrector loop

View File

@ -1,18 +1,4 @@
{
wordList pcorrTypes
(
p.boundaryField().size(),
zeroGradientFvPatchScalarField::typeName
);
forAll (p.boundaryField(), i)
{
if (p.boundaryField()[i].fixesValue())
{
pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
}
}
volScalarField pcorr
(
IOobject
@ -29,7 +15,7 @@
);
surfaceScalarField rhof(fvc::interpolate(rho, "div(phiv,rho)"));
dimensionedScalar rAUf("(1|A(U))", dimTime, 1.0);
dimensionedScalar rAUf("rAUf", dimTime, 1.0);
while (pimple.correctNonOrthogonal())
{

View File

@ -18,7 +18,7 @@
HbyA = rAU*UEqn.H();
phiv = (fvc::interpolate(HbyA) & mesh.Sf())
+ rhorAUf*fvc::ddtCorr(U, phivAbs);
+ rhorAUf*fvc::ddtCorr(U, Uf);
fvc::makeRelative(phiv, U);
surfaceScalarField phiGradp(rhorAUf*mesh.magSf()*fvc::snGrad(p));
@ -43,7 +43,6 @@
if (pimple.finalNonOrthogonalIter())
{
phiv += (phiGradp + pEqn.flux())/rhof;
phivAbs = fvc::absolute(phiv, U);
}
}
@ -82,4 +81,10 @@
U.correctBoundaryConditions();
Info<< "max(U) " << max(mag(U)).value() << endl;
{
Uf = fvc::interpolate(U);
surfaceVectorField n(mesh.Sf()/mesh.magSf());
Uf += mesh.Sf()*(phiv - (mesh.Sf() & Uf))/sqr(mesh.magSf());
}
}

View File

@ -0,0 +1,9 @@
#include "readTimeControls.H"
scalar maxAcousticCo
(
readScalar(runTime.controlDict().lookup("maxAcousticCo"))
);
bool correctPhi =
pimple.dict().lookupOrDefault<Switch>("correctPhi", true);