From 34eb8a75ec3ae6a1f391ce22253aeb6bea4c4b1f Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 28 Nov 2011 12:57:59 +0000 Subject: [PATCH] interDyMFoam: Corrected handling of relative and absolute fluxes in correctPhi --- .../multiphase/interFoam/interDyMFoam/correctPhi.H | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 applications/solvers/multiphase/interFoam/interDyMFoam/correctPhi.H diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/correctPhi.H b/applications/solvers/multiphase/interFoam/interDyMFoam/correctPhi.H new file mode 100644 index 00000000..0e373e1f --- /dev/null +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/correctPhi.H @@ -0,0 +1,58 @@ +{ + #include "continuityErrs.H" + + wordList pcorrTypes + ( + p_rgh.boundaryField().size(), + zeroGradientFvPatchScalarField::typeName + ); + + forAll (p_rgh.boundaryField(), i) + { + if (p_rgh.boundaryField()[i].fixesValue()) + { + pcorrTypes[i] = fixedValueFvPatchScalarField::typeName; + } + } + + volScalarField pcorr + ( + IOobject + ( + "pcorr", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("pcorr", p_rgh.dimensions(), 0.0), + pcorrTypes + ); + + dimensionedScalar rAUf("(1|A(U))", dimTime/rho.dimensions(), 1.0); + + adjustPhi(phi, U, pcorr); + + fvc::makeAbsolute(phi, U); + + while (pimple.correctNonOrthogonal()) + { + fvScalarMatrix pcorrEqn + ( + fvm::laplacian(rAUf, pcorr) == fvc::div(phi) + ); + + pcorrEqn.setReference(pRefCell, pRefValue); + pcorrEqn.solve(); + + if (pimple.finalNonOrthogonalIter()) + { + phi -= pcorrEqn.flux(); + phiAbs = phi; + fvc::makeRelative(phi, U); + } + } + + #include "continuityErrs.H" +} -- 2.11.4.GIT