coldEngineFoam: superseded by rhoPimpleFoam with fvMeshMover::engine

With the general run-time selectable fvMeshMovers engine compression simulations
can be performed with rhoPimpleFoam so there is no longer any need for engine
specific solvers.

A coldEngineFoam script is provided to redirect users to rhoPimpleFoam with
instructions.
This commit is contained in:
Henry Weller
2021-11-07 19:09:44 +00:00
parent 49faf0be14
commit 640cd66a65
8 changed files with 59 additions and 266 deletions

View File

@ -1,3 +0,0 @@
coldEngineFoam.C
EXE = $(FOAM_APPBIN)/coldEngineFoam

View File

@ -1,28 +0,0 @@
EXE_INC = \
-I. \
-I../XiFoam/XiEngineFoam \
-I../XiFoam \
-I../../compressible/rhoPimpleFoam \
-I$(LIB_SRC)/engine/lnInclude \
-I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
-I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
EXE_LIBS = \
-lengine \
-lfluidThermophysicalModels \
-lmomentumTransportModels \
-lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \
-lspecie \
-lfiniteVolume \
-lmeshTools \
-lfvModels \
-lfvConstraints

View File

@ -1,120 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
engineFoam
Description
Solver for cold-flow in internal combustion engines.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "engineMesh.H"
#include "psiThermo.H"
#include "compressibleMomentumTransportModels.H"
#include "fluidThermophysicalTransportModel.H"
#include "OFstream.H"
#include "fvModels.H"
#include "fvConstraints.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#define CREATE_MESH createEngineMesh.H
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createEngineMesh.H"
#include "createControl.H"
#include "createFields.H"
#include "createFieldRefs.H"
#include "createRhoUfIfPresent.H"
#include "initContinuityErrs.H"
#include "createEngineTimeControls.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
#include "startSummary.H"
turbulence->validate();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (pimple.run(runTime))
{
#include "readEngineTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Engine time = " << runTime.userTimeName() << endl;
fvModels.preUpdateMesh();
mesh.move();
#include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
fvModels.correct();
#include "UEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
#include "EEqn.H"
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence->correct();
thermophysicalTransport->correct();
}
}
runTime.write();
#include "logSummary.H"
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,2 +0,0 @@
const volScalarField& psi = thermo.psi();
const volScalarField& T = thermo.T();

View File

@ -1,78 +0,0 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<psiThermo> pThermo
(
psiThermo::New(mesh)
);
psiThermo& thermo = pThermo();
thermo.validate(args.executable(), "h", "e");
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo.rho()
);
volScalarField& p = thermo.p();
Info<< "\nReading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::momentumTransportModel> turbulence
(
compressible::momentumTransportModel::New
(
rho,
U,
phi,
thermo
)
);
Info<< "Creating thermophysical transport model\n" << endl;
autoPtr<fluidThermophysicalTransportModel> thermophysicalTransport
(
fluidThermophysicalTransportModel::New(turbulence(), thermo)
);
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar(p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
#include "createMRF.H"
#include "createFvModels.H"
#include "createFvConstraints.H"

View File

@ -1,20 +0,0 @@
{
const scalar meanp = p.weightedAverage(mesh.V()).value();
const scalar meanT = T.weightedAverage(mesh.V()).value();
const scalar meanup =
(sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value();
if (Pstream::master())
{
Info<< "Mean pressure:" << meanp << endl;
Info<< "Mean temperature:" << meanT << endl;
Info<< "Mean u':" << meanup << endl;
logSummaryFile()
<< runTime.userTimeValue() << tab
<< meanp << tab
<< meanT << tab
<< meanup
<< endl;
}
}

View File

@ -1,15 +0,0 @@
Info<< "Total cylinder mass: " << fvc::domainIntegrate(rho).value() << endl;
autoPtr<OFstream> logSummaryFile;
if (Pstream::master())
{
logSummaryFile = new OFstream
(
runTime.rootPath()/runTime.globalCaseName()
/("logSummary." + runTime.timeName() + ".dat")
);
logSummaryFile()
<< "# CA" << " p" << " T" << " u'" << endl;
}

59
bin/coldEngineFoam Executable file
View File

@ -0,0 +1,59 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2021 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# coldEngineFoam
#
# Description
# Script to inform the user that coldEngineFoam has been replaced by the
# more general rhoPimpleFoam solver.
#
#------------------------------------------------------------------------------
cat << EOF
The coldEngineFoam solver has solver has been replaced by the more general rhoPimpleFoam
solver, which supports engine mesh motion using an appropriate
fvMeshMover. e.g. layeredEngine
To run a coldEngineFoam case in rhoPimpleFoam add a mover entry in
constant/dynamicMeshDict
e.g. from the tutorials/combustion/rhoPimpleFoam/RAS/kivaTest case:
mover
{
type layeredEngine;
libs ("libfvMeshMovers.so");
conRodLength 0.147;
bore 0.092;
stroke 0.08423;
clearance 0.00115;
pistonLayers 0;
}
EOF
#------------------------------------------------------------------------------