ENH: Updated pressure-work term creation for moving meshes

This commit is contained in:
Andrew Heather
2017-06-27 11:18:55 +01:00
parent 2582190820
commit bf2ed1abcf
3 changed files with 37 additions and 12 deletions

View File

@ -40,6 +40,8 @@ SourceFiles
#include "autoPtr.H" #include "autoPtr.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
#define MOVING_MESH
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam

View File

@ -40,6 +40,8 @@ SourceFiles
#include "autoPtr.H" #include "autoPtr.H"
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
#define MOVING_MESH
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam

View File

@ -1,18 +1,39 @@
Info<< "Creating field dpdt\n" << endl; #if defined(MOVING_MESH)
volScalarField dpdt Info<< "Creating field dpdt for moving meshes\n" << endl;
(
IOobject // Note: set to read if present and auto write to simplify dpdt correction
// by meshPhi
volScalarField dpdt
( (
"dpdt", IOobject
runTime.timeName(), (
mesh, "dpdt",
IOobject::NO_READ, runTime.timeName(),
IOobject::NO_WRITE mesh,
), IOobject::READ_IF_PRESENT,
fvc::ddt(p) IOobject::AUTO_WRITE
); ),
fvc::ddt(p)
);
#else
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::ddt(p)
);
#endif
if (!thermo.dpdt()) if (!thermo.dpdt())
{ {
dpdt == dimensionedScalar("0", dpdt.dimensions(), 0); dpdt == dimensionedScalar("0", dpdt.dimensions(), 0);
dpdt.writeOpt() = IOobject::NO_WRITE;
} }