mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Updated pressure-work term creation for moving meshes
This commit is contained in:
@ -40,6 +40,8 @@ SourceFiles
|
||||
#include "autoPtr.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
#define MOVING_MESH
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
|
||||
@ -40,6 +40,8 @@ SourceFiles
|
||||
#include "autoPtr.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
#define MOVING_MESH
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
|
||||
@ -1,18 +1,39 @@
|
||||
Info<< "Creating field dpdt\n" << endl;
|
||||
volScalarField dpdt
|
||||
(
|
||||
IOobject
|
||||
#if defined(MOVING_MESH)
|
||||
Info<< "Creating field dpdt for moving meshes\n" << endl;
|
||||
|
||||
// Note: set to read if present and auto write to simplify dpdt correction
|
||||
// by meshPhi
|
||||
volScalarField dpdt
|
||||
(
|
||||
"dpdt",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
fvc::ddt(p)
|
||||
);
|
||||
IOobject
|
||||
(
|
||||
"dpdt",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
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())
|
||||
{
|
||||
dpdt == dimensionedScalar("0", dpdt.dimensions(), 0);
|
||||
dpdt.writeOpt() = IOobject::NO_WRITE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user