mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Added p to interFoam
Changed formatting of interDyMFoam
This commit is contained in:
@ -46,18 +46,17 @@ Description
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
#include "setRootCase.H"
|
||||||
# include "setRootCase.H"
|
#include "createTime.H"
|
||||||
# include "createTime.H"
|
#include "createDynamicFvMesh.H"
|
||||||
# include "createDynamicFvMesh.H"
|
#include "readEnvironmentalProperties.H"
|
||||||
# include "readEnvironmentalProperties.H"
|
#include "readPISOControls.H"
|
||||||
# include "readPISOControls.H"
|
#include "initContinuityErrs.H"
|
||||||
# include "initContinuityErrs.H"
|
#include "createFields.H"
|
||||||
# include "createFields.H"
|
#include "readTimeControls.H"
|
||||||
# include "readTimeControls.H"
|
#include "correctPhi.H"
|
||||||
# include "correctPhi.H"
|
#include "CourantNo.H"
|
||||||
# include "CourantNo.H"
|
#include "setInitialDeltaT.H"
|
||||||
# include "setInitialDeltaT.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -65,10 +64,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
while (runTime.run())
|
while (runTime.run())
|
||||||
{
|
{
|
||||||
# include "readControls.H"
|
#include "readControls.H"
|
||||||
# include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
|
|
||||||
# include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
@ -97,7 +96,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (mesh.changing() && correctPhi)
|
if (mesh.changing() && correctPhi)
|
||||||
{
|
{
|
||||||
# include "correctPhi.H"
|
#include "correctPhi.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the fluxes relative to the mesh motion
|
// Make the fluxes relative to the mesh motion
|
||||||
@ -108,22 +107,22 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (mesh.changing() && checkMeshCourantNo)
|
if (mesh.changing() && checkMeshCourantNo)
|
||||||
{
|
{
|
||||||
# include "meshCourantNo.H"
|
#include "meshCourantNo.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
twoPhaseProperties.correct();
|
twoPhaseProperties.correct();
|
||||||
|
|
||||||
# include "gammaEqnSubCycle.H"
|
#include "gammaEqnSubCycle.H"
|
||||||
|
|
||||||
# include "UEqn.H"
|
#include "UEqn.H"
|
||||||
|
|
||||||
// --- PISO loop
|
// --- PISO loop
|
||||||
for (int corr=0; corr<nCorr; corr++)
|
for (int corr=0; corr<nCorr; corr++)
|
||||||
{
|
{
|
||||||
# include "pEqn.H"
|
#include "pEqn.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
# include "continuityErrs.H"
|
#include "continuityErrs.H"
|
||||||
|
|
||||||
p = pd + rho*gh;
|
p = pd + rho*gh;
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
Info<< "Reading transportProperties\n" << endl;
|
Info<< "Reading transportProperties\n" << endl;
|
||||||
twoPhaseMixture twoPhaseProperties(U, phi, "gamma");
|
twoPhaseMixture twoPhaseProperties(U, phi, "gamma");
|
||||||
|
|
||||||
const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
|
const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
|
||||||
const dimensionedScalar& rho2 = twoPhaseProperties.rho2();
|
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;
|
label pdRefCell = 0;
|
||||||
scalar pdRefValue = 0.0;
|
scalar pdRefValue = 0.0;
|
||||||
setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue);
|
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
|
// Construct interface from gamma distribution
|
||||||
interfaceProperties interface(gamma, U, twoPhaseProperties);
|
interfaceProperties interface(gamma, U, twoPhaseProperties);
|
||||||
|
|||||||
@ -45,18 +45,17 @@ Description
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
#include "setRootCase.H"
|
||||||
# include "setRootCase.H"
|
#include "createTime.H"
|
||||||
# include "createTime.H"
|
#include "createMesh.H"
|
||||||
# include "createMesh.H"
|
#include "readEnvironmentalProperties.H"
|
||||||
# include "readEnvironmentalProperties.H"
|
#include "readPISOControls.H"
|
||||||
# include "readPISOControls.H"
|
#include "initContinuityErrs.H"
|
||||||
# include "initContinuityErrs.H"
|
#include "createFields.H"
|
||||||
# include "createFields.H"
|
#include "readTimeControls.H"
|
||||||
# include "readTimeControls.H"
|
#include "correctPhi.H"
|
||||||
# include "correctPhi.H"
|
#include "CourantNo.H"
|
||||||
# include "CourantNo.H"
|
#include "setInitialDeltaT.H"
|
||||||
# include "setInitialDeltaT.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -64,10 +63,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
while (runTime.run())
|
while (runTime.run())
|
||||||
{
|
{
|
||||||
# include "readPISOControls.H"
|
#include "readPISOControls.H"
|
||||||
# include "readTimeControls.H"
|
#include "readTimeControls.H"
|
||||||
# include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
# include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
@ -75,17 +74,19 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
twoPhaseProperties.correct();
|
twoPhaseProperties.correct();
|
||||||
|
|
||||||
# include "gammaEqnSubCycle.H"
|
#include "gammaEqnSubCycle.H"
|
||||||
|
|
||||||
# include "UEqn.H"
|
#include "UEqn.H"
|
||||||
|
|
||||||
// --- PISO loop
|
// --- PISO loop
|
||||||
for (int corr=0; corr<nCorr; corr++)
|
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();
|
runTime.write();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user