mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
To unsure fvOptions are instantiated for post-processing createFvOptions.H must be included in createFields.H rather than in the solver directly. Resolves bug-report https://bugs.openfoam.org/view.php?id=2733 BUG: porousSimpleFoam: moved createFvOptions.H into createFields.H for -postProcess option Resolves bug-report https://bugs.openfoam.org/view.php?id=2733 BUG: solvers: Moved fvOption construction into createFields.H for post-processing This ensures that the fvOptions are constructed for the -postProcessing option so that functionObjects which process fvOption data operate correctly in this mode.
125 lines
2.1 KiB
C
125 lines
2.1 KiB
C
Info<< "Reading field p\n" << endl;
|
|
volScalarField p
|
|
(
|
|
IOobject
|
|
(
|
|
"p",
|
|
runTime.timeName(),
|
|
mesh,
|
|
IOobject::MUST_READ,
|
|
IOobject::AUTO_WRITE
|
|
),
|
|
mesh
|
|
);
|
|
|
|
Info<< "Reading field U\n" << endl;
|
|
volVectorField U
|
|
(
|
|
IOobject
|
|
(
|
|
"U",
|
|
runTime.timeName(),
|
|
mesh,
|
|
IOobject::MUST_READ,
|
|
IOobject::AUTO_WRITE
|
|
),
|
|
mesh
|
|
);
|
|
|
|
#include "createPhi.H"
|
|
|
|
|
|
label pRefCell = 0;
|
|
scalar pRefValue = 0.0;
|
|
setRefCell(p, simple.dict(), pRefCell, pRefValue);
|
|
mesh.setFluxRequired(p.name());
|
|
|
|
|
|
Info<< "Reading field pa\n" << endl;
|
|
volScalarField pa
|
|
(
|
|
IOobject
|
|
(
|
|
"pa",
|
|
runTime.timeName(),
|
|
mesh,
|
|
IOobject::MUST_READ,
|
|
IOobject::AUTO_WRITE
|
|
),
|
|
mesh
|
|
);
|
|
|
|
Info<< "Reading field Ua\n" << endl;
|
|
volVectorField Ua
|
|
(
|
|
IOobject
|
|
(
|
|
"Ua",
|
|
runTime.timeName(),
|
|
mesh,
|
|
IOobject::MUST_READ,
|
|
IOobject::AUTO_WRITE
|
|
),
|
|
mesh
|
|
);
|
|
|
|
#include "createPhia.H"
|
|
|
|
|
|
label paRefCell = 0;
|
|
scalar paRefValue = 0.0;
|
|
setRefCell
|
|
(
|
|
pa,
|
|
simple.dict(),
|
|
paRefCell,
|
|
paRefValue
|
|
);
|
|
mesh.setFluxRequired(pa.name());
|
|
|
|
|
|
singlePhaseTransportModel laminarTransport(U, phi);
|
|
|
|
autoPtr<incompressible::turbulenceModel> turbulence
|
|
(
|
|
incompressible::turbulenceModel::New(U, phi, laminarTransport)
|
|
);
|
|
|
|
|
|
dimensionedScalar zeroSensitivity(dimVelocity*dimVelocity, Zero);
|
|
dimensionedScalar zeroAlpha(dimless/dimTime, Zero);
|
|
|
|
dimensionedScalar lambda
|
|
(
|
|
"lambda",
|
|
dimTime/sqr(dimLength),
|
|
laminarTransport
|
|
);
|
|
|
|
dimensionedScalar alphaMax
|
|
(
|
|
"alphaMax",
|
|
dimless/dimTime,
|
|
laminarTransport
|
|
);
|
|
|
|
const labelList& inletCells = mesh.boundary()["inlet"].faceCells();
|
|
//const labelList& outletCells = mesh.boundary()["outlet"].faceCells();
|
|
|
|
volScalarField alpha
|
|
(
|
|
IOobject
|
|
(
|
|
"alpha",
|
|
runTime.timeName(),
|
|
mesh,
|
|
IOobject::READ_IF_PRESENT,
|
|
IOobject::AUTO_WRITE
|
|
),
|
|
lambda*max(Ua & U, zeroSensitivity)
|
|
);
|
|
zeroCells(alpha, inletCells);
|
|
//zeroCells(alpha, outletCells);
|
|
|
|
#include "createFvOptions.H"
|