ENH: chtMultiRegionFoam: support for -dry-run. Fixes #2446
This commit is contained in:
parent
bc2299ed5f
commit
c78101a9ae
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2019,2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -70,6 +70,7 @@ int main(int argc, char *argv[])
|
||||
#define CREATE_MESH createMeshesPostProcess.H
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCaseLists.H"
|
||||
#include "createTime.H"
|
||||
#include "createMeshes.H"
|
||||
|
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2019,2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -62,6 +62,7 @@ int main(int argc, char *argv[])
|
||||
#define CREATE_MESH createMeshesPostProcess.H
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCaseLists.H"
|
||||
#include "createTime.H"
|
||||
#include "createMeshes.H"
|
||||
|
@ -4,21 +4,61 @@
|
||||
|
||||
forAll(fluidNames, i)
|
||||
{
|
||||
Info<< "Create fluid mesh for region " << fluidNames[i]
|
||||
<< " for time = " << runTime.timeName() << nl << endl;
|
||||
if (args.dryRun() || args.found("dry-run-write"))
|
||||
{
|
||||
Info
|
||||
<< "Operating in 'dry-run' mode:"
|
||||
<< " case will run for 1 time step. "
|
||||
<< "All checks assumed OK on a clean exit" << endl;
|
||||
|
||||
fluidRegions.set
|
||||
(
|
||||
i,
|
||||
new fvMesh
|
||||
FieldBase::allowConstructFromLargerSize = true;
|
||||
|
||||
// Create a simplified 1D mesh and attempt to re-create boundary
|
||||
// conditions
|
||||
fluidRegions.set
|
||||
(
|
||||
IOobject
|
||||
i,
|
||||
new simplifiedMeshes::columnFvMesh(runTime, fluidNames[i])
|
||||
);
|
||||
|
||||
// Stop after 1 iteration of the simplified mesh
|
||||
|
||||
if (args.found("dry-run-write"))
|
||||
{
|
||||
// Using saWriteNow triggers function objects execute(), write()
|
||||
runTime.stopAt(Time::saWriteNow);
|
||||
|
||||
// Make sure mesh gets output to the current time (since
|
||||
// instance no longer constant)
|
||||
fluidRegions[i].setInstance(runTime.timeName());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Using saNoWriteNow triggers function objects execute(),
|
||||
// but not write()
|
||||
runTime.stopAt(Time::saNoWriteNow);
|
||||
}
|
||||
|
||||
functionObject::outputPrefix = "postProcessing-dry-run";
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Create fluid mesh for region " << fluidNames[i]
|
||||
<< " for time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
fluidRegions.set
|
||||
(
|
||||
i,
|
||||
new fvMesh
|
||||
(
|
||||
fluidNames[i],
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
IOobject
|
||||
(
|
||||
fluidNames[i],
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -67,6 +67,7 @@ int main(int argc, char *argv[])
|
||||
#define CREATE_MESH createMeshesPostProcess.H
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMeshes.H"
|
||||
|
@ -4,21 +4,61 @@
|
||||
|
||||
forAll(fluidNames, i)
|
||||
{
|
||||
Info<< "Create fluid mesh for region " << fluidNames[i]
|
||||
<< " for time = " << runTime.timeName() << nl << endl;
|
||||
if (args.dryRun() || args.found("dry-run-write"))
|
||||
{
|
||||
Info
|
||||
<< "Operating in 'dry-run' mode:"
|
||||
<< " case will run for 1 time step. "
|
||||
<< "All checks assumed OK on a clean exit" << endl;
|
||||
|
||||
fluidRegions.set
|
||||
(
|
||||
i,
|
||||
new fvMesh
|
||||
FieldBase::allowConstructFromLargerSize = true;
|
||||
|
||||
// Create a simplified 1D mesh and attempt to re-create boundary
|
||||
// conditions
|
||||
fluidRegions.set
|
||||
(
|
||||
IOobject
|
||||
i,
|
||||
new simplifiedMeshes::columnFvMesh(runTime, fluidNames[i])
|
||||
);
|
||||
|
||||
// Stop after 1 iteration of the simplified mesh
|
||||
|
||||
if (args.found("dry-run-write"))
|
||||
{
|
||||
// Using saWriteNow triggers function objects execute(), write()
|
||||
runTime.stopAt(Time::saWriteNow);
|
||||
|
||||
// Make sure mesh gets output to the current time (since
|
||||
// instance no longer constant)
|
||||
fluidRegions[i].setInstance(runTime.timeName());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Using saNoWriteNow triggers function objects execute(),
|
||||
// but not write()
|
||||
runTime.stopAt(Time::saNoWriteNow);
|
||||
}
|
||||
|
||||
functionObject::outputPrefix = "postProcessing-dry-run";
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Create fluid mesh for region " << fluidNames[i]
|
||||
<< " for time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
fluidRegions.set
|
||||
(
|
||||
i,
|
||||
new fvMesh
|
||||
(
|
||||
fluidNames[i],
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
IOobject
|
||||
(
|
||||
fluidNames[i],
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -4,26 +4,67 @@
|
||||
|
||||
forAll(solidNames, i)
|
||||
{
|
||||
Info<< "Create solid mesh for region " << solidNames[i]
|
||||
<< " for time = " << runTime.timeName() << nl << endl;
|
||||
if (args.dryRun() || args.found("dry-run-write"))
|
||||
{
|
||||
Info
|
||||
<< "Operating in 'dry-run' mode:"
|
||||
<< " case will run for 1 time step. "
|
||||
<< "All checks assumed OK on a clean exit" << endl;
|
||||
|
||||
solidRegions.set
|
||||
(
|
||||
i,
|
||||
new fvMesh
|
||||
FieldBase::allowConstructFromLargerSize = true;
|
||||
|
||||
// Create a simplified 1D mesh and attempt to re-create boundary
|
||||
// conditions
|
||||
solidRegions.set
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
solidNames[i],
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
)
|
||||
);
|
||||
i,
|
||||
new simplifiedMeshes::columnFvMesh(runTime, solidNames[i])
|
||||
);
|
||||
|
||||
// Force calculation of geometric properties to prevent it being done
|
||||
// later in e.g. some boundary evaluation
|
||||
//(void)solidRegions[i].weights();
|
||||
//(void)solidRegions[i].deltaCoeffs();
|
||||
// Stop after 1 iteration of the simplified mesh
|
||||
|
||||
if (args.found("dry-run-write"))
|
||||
{
|
||||
// Using saWriteNow triggers function objects execute(), write()
|
||||
runTime.stopAt(Time::saWriteNow);
|
||||
|
||||
// Make sure mesh gets output to the current time (since
|
||||
// instance no longer constant)
|
||||
solidRegions[i].setInstance(runTime.timeName());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Using saNoWriteNow triggers function objects execute(),
|
||||
// but not write()
|
||||
runTime.stopAt(Time::saNoWriteNow);
|
||||
}
|
||||
|
||||
functionObject::outputPrefix = "postProcessing-dry-run";
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Create solid mesh for region " << solidNames[i]
|
||||
<< " for time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
solidRegions.set
|
||||
(
|
||||
i,
|
||||
new fvMesh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
solidNames[i],
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Force calculation of geometric properties to prevent it being
|
||||
// done
|
||||
// later in e.g. some boundary evaluation
|
||||
//(void)solidRegions[i].weights();
|
||||
//(void)solidRegions[i].deltaCoeffs();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user