Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

interDyMFoam: Corrected handling of relative and absolute fluxes in c…

…orrectPhi
  • Loading branch information...
commit 34eb8a75ec3ae6a1f391ce22253aeb6bea4c4b1f 1 parent 03233a7
Henry authored
View
58 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"
+}
Please sign in to comment.
Something went wrong with that request. Please try again.