From f92fbeb9f9dd4af7aaec3ea4e560d12bb7f6a5e3 Mon Sep 17 00:00:00 2001 From: henry <Henry Weller h.weller@opencfd.co.uk> Date: Wed, 7 May 2008 22:34:36 +0100 Subject: [PATCH] Added p to interFoam Changed formatting of interDyMFoam --- .../multiphase/interDyMFoam/interDyMFoam.C | 41 +++++++++---------- .../multiphase/interFoam/createFields.H | 25 ++++++++--- .../solvers/multiphase/interFoam/interFoam.C | 41 ++++++++++--------- 3 files changed, 61 insertions(+), 46 deletions(-) diff --git a/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C index 12e03c3c8bf..b3046c7fbb9 100644 --- a/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C +++ b/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C @@ -46,18 +46,17 @@ Description int main(int argc, char *argv[]) { - -# include "setRootCase.H" -# include "createTime.H" -# include "createDynamicFvMesh.H" -# include "readEnvironmentalProperties.H" -# include "readPISOControls.H" -# include "initContinuityErrs.H" -# include "createFields.H" -# include "readTimeControls.H" -# include "correctPhi.H" -# include "CourantNo.H" -# include "setInitialDeltaT.H" + #include "setRootCase.H" + #include "createTime.H" + #include "createDynamicFvMesh.H" + #include "readEnvironmentalProperties.H" + #include "readPISOControls.H" + #include "initContinuityErrs.H" + #include "createFields.H" + #include "readTimeControls.H" + #include "correctPhi.H" + #include "CourantNo.H" + #include "setInitialDeltaT.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -65,10 +64,10 @@ int main(int argc, char *argv[]) while (runTime.run()) { -# include "readControls.H" -# include "CourantNo.H" + #include "readControls.H" + #include "CourantNo.H" -# include "setDeltaT.H" + #include "setDeltaT.H" runTime++; @@ -97,7 +96,7 @@ int main(int argc, char *argv[]) if (mesh.changing() && correctPhi) { -# include "correctPhi.H" + #include "correctPhi.H" } // Make the fluxes relative to the mesh motion @@ -108,22 +107,22 @@ int main(int argc, char *argv[]) if (mesh.changing() && checkMeshCourantNo) { -# include "meshCourantNo.H" + #include "meshCourantNo.H" } twoPhaseProperties.correct(); -# include "gammaEqnSubCycle.H" + #include "gammaEqnSubCycle.H" -# include "UEqn.H" + #include "UEqn.H" // --- PISO loop for (int corr=0; corr<nCorr; corr++) { -# include "pEqn.H" + #include "pEqn.H" } -# include "continuityErrs.H" + #include "continuityErrs.H" p = pd + rho*gh; diff --git a/applications/solvers/multiphase/interFoam/createFields.H b/applications/solvers/multiphase/interFoam/createFields.H index 239779ce2e4..887bcbdead1 100644 --- a/applications/solvers/multiphase/interFoam/createFields.H +++ b/applications/solvers/multiphase/interFoam/createFields.H @@ -45,7 +45,7 @@ Info<< "Reading transportProperties\n" << endl; twoPhaseMixture twoPhaseProperties(U, phi, "gamma"); - + const dimensionedScalar& rho1 = twoPhaseProperties.rho1(); const dimensionedScalar& rho2 = twoPhaseProperties.rho2(); @@ -83,14 +83,29 @@ ); + Info<< "Calculating field g.h\n" << endl; + volScalarField gh("gh", g & mesh.C()); + surfaceScalarField ghf("gh", g & mesh.Cf()); + + + volScalarField p + ( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + pd + rho*gh + ); + + label pdRefCell = 0; scalar pdRefValue = 0.0; setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue); - Info<< "Calculating field g.h\n" << endl; - surfaceScalarField ghf("gh", g & mesh.Cf()); - - // Construct interface from gamma distribution interfaceProperties interface(gamma, U, twoPhaseProperties); diff --git a/applications/solvers/multiphase/interFoam/interFoam.C b/applications/solvers/multiphase/interFoam/interFoam.C index 89b7ecc5cda..f6931116801 100644 --- a/applications/solvers/multiphase/interFoam/interFoam.C +++ b/applications/solvers/multiphase/interFoam/interFoam.C @@ -45,18 +45,17 @@ Description int main(int argc, char *argv[]) { - -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" -# include "readEnvironmentalProperties.H" -# include "readPISOControls.H" -# include "initContinuityErrs.H" -# include "createFields.H" -# include "readTimeControls.H" -# include "correctPhi.H" -# include "CourantNo.H" -# include "setInitialDeltaT.H" + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readEnvironmentalProperties.H" + #include "readPISOControls.H" + #include "initContinuityErrs.H" + #include "createFields.H" + #include "readTimeControls.H" + #include "correctPhi.H" + #include "CourantNo.H" + #include "setInitialDeltaT.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -64,10 +63,10 @@ int main(int argc, char *argv[]) while (runTime.run()) { -# include "readPISOControls.H" -# include "readTimeControls.H" -# include "CourantNo.H" -# include "setDeltaT.H" + #include "readPISOControls.H" + #include "readTimeControls.H" + #include "CourantNo.H" + #include "setDeltaT.H" runTime++; @@ -75,17 +74,19 @@ int main(int argc, char *argv[]) twoPhaseProperties.correct(); -# include "gammaEqnSubCycle.H" + #include "gammaEqnSubCycle.H" -# include "UEqn.H" + #include "UEqn.H" // --- PISO loop for (int corr=0; corr<nCorr; corr++) { -# include "pEqn.H" + #include "pEqn.H" } -# include "continuityErrs.H" + #include "continuityErrs.H" + + p = pd + rho*gh; runTime.write(); -- GitLab