engineTime: Completely replaced engineTime derived from Time

with the run-time selectable engine userTime embedded in Time.

All parts of the original engineTime relating to the engine geometry have been
moved to engineMesh.  This is part of the process of integrating engine
simulations within the standard moving-mesh solvers.
This commit is contained in:
Henry Weller
2021-11-03 19:33:41 +00:00
parent 7f56646aba
commit e10830632e
31 changed files with 222 additions and 1232 deletions

View File

@ -49,7 +49,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "engineTime.H"
#include "engineMesh.H"
#include "psiuReactionThermo.H"
#include "compressibleMomentumTransportModels.H"
@ -67,12 +66,11 @@ Description
int main(int argc, char *argv[])
{
#define CREATE_TIME createEngineTime.H
#define CREATE_MESH createEngineMesh.H
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "createEngineTime.H"
#include "createTime.H"
#include "createEngineMesh.H"
#include "createControl.H"
#include "readCombustionProperties.H"
@ -99,7 +97,7 @@ int main(int argc, char *argv[])
runTime++;
Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;
Info<< "Crank angle = " << runTime.timeName() << endl;
mesh.move();

View File

@ -12,7 +12,7 @@
Info<< "Mean u':" << meanup << endl;
logSummaryFile()
<< runTime.theta() << tab
<< runTime.userTimeValue() << tab
<< meanp << tab
<< meanT << tab
<< meanup << tab

View File

@ -30,7 +30,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "engineTime.H"
#include "engineMesh.H"
#include "psiThermo.H"
#include "compressibleMomentumTransportModels.H"
@ -44,12 +43,11 @@ Description
int main(int argc, char *argv[])
{
#define CREATE_TIME createEngineTime.H
#define CREATE_MESH createEngineMesh.H
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "createEngineTime.H"
#include "createTime.H"
#include "createEngineMesh.H"
#include "createControl.H"
#include "createFields.H"

View File

@ -11,7 +11,7 @@
Info<< "Mean u':" << meanup << endl;
logSummaryFile()
<< runTime.theta() << tab
<< runTime.userTimeValue() << tab
<< meanp << tab
<< meanT << tab
<< meanup

View File

@ -47,12 +47,11 @@ Description
int main(int argc, char *argv[])
{
#define CREATE_TIME createEngineTime.H
#define CREATE_MESH createEngineMesh.H
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "createEngineTime.H"
#include "createTime.H"
#include "createEngineMesh.H"
#include "createEngineControls.H"
#include "initContinuityErrs.H"

View File

@ -5,7 +5,7 @@ Info<< "Mean u':"
<< endl;
logSummaryFile
<< runTime.theta() << tab
<< runTime.userTimeValue() << tab
<< p.weightedAverage(mesh.V()).value() << tab
<< T.weightedAverage(mesh.V()).value() << tab
<< (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,7 +30,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "engineTime.H"
#include "engineMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -39,7 +38,7 @@ int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createEngineTime.H"
#include "createTime.H"
#include "createEngineMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +47,7 @@ int main(int argc, char *argv[])
while (runTime.loop())
{
Info<< "Time = " << runTime.theta() << " CA-deg\n" << endl;
Info<< "Time = " << runTime.timeName() << endl;
mesh.move();

View File

@ -32,7 +32,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "engineTime.H"
#include "engineMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -40,7 +39,7 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createEngineTime.H"
#include "createTime.H"
#include "createEngineMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -51,29 +50,29 @@ int main(int argc, char *argv[])
scalar ca0 = -180.0;
scalar ca1 = 0.0;
while (runTime.theta() > ca0)
while (runTime.userTimeValue() > ca0)
{
ca0 += fullCycle;
ca1 += fullCycle;
}
while (mag(runTime.theta() - ca0) > eps)
while (mag(runTime.userTimeValue() - ca0) > eps)
{
scalar t0 = runTime.userTimeToTime(ca0 - runTime.theta());
scalar t0 = runTime.userTimeToTime(ca0 - runTime.userTimeValue());
runTime.setDeltaT(t0);
runTime++;
Info<< "CA = " << runTime.theta() << endl;
Info<< "CA = " << runTime.userTimeValue() << endl;
mesh.move();
}
scalar Vmax = sum(mesh.V().field());
while (mag(runTime.theta()-ca1) > eps)
while (mag(runTime.userTimeValue()-ca1) > eps)
{
scalar t1 = runTime.userTimeToTime(ca1 - runTime.theta());
scalar t1 = runTime.userTimeToTime(ca1 - runTime.userTimeValue());
runTime.setDeltaT(t1);
runTime++;
Info<< "CA = " << runTime.theta() << endl;
Info<< "CA = " << runTime.userTimeValue() << endl;
mesh.move();
}

View File

@ -116,6 +116,7 @@ void Foam::Time::setControls()
if (startFrom == "startTime")
{
controlDict_.lookup("startTime") >> startTime_;
startTime_ = userTimeToTime(startTime_);
}
else
{
@ -128,11 +129,11 @@ void Foam::Time::setControls()
{
if (timeDirs[0].name() == constant() && timeDirs.size() >= 2)
{
startTime_ = timeDirs[1].value();
startTime_ = userTimeToTime(timeDirs[1].value());
}
else
{
startTime_ = timeDirs[0].value();
startTime_ = userTimeToTime(timeDirs[0].value());
}
}
}
@ -140,7 +141,7 @@ void Foam::Time::setControls()
{
if (timeDirs.size())
{
startTime_ = timeDirs.last().value();
startTime_ = userTimeToTime(timeDirs.last().value());
}
}
else
@ -153,7 +154,6 @@ void Foam::Time::setControls()
}
setTime(startTime_, 0);
readDict();
deltaTSave_ = deltaT_;
deltaT0_ = deltaT_;
@ -177,6 +177,7 @@ void Foam::Time::setControls()
setTime(startTime_, 0);
word newTime(timeName());
if (newTime == oldTime)
{
break;

View File

@ -40,7 +40,7 @@ void Foam::Time::readDict()
if (!deltaTchanged_)
{
deltaT_ = controlDict_.lookup<scalar>("deltaT");
deltaT_ = userTimeToTime(controlDict_.lookup<scalar>("deltaT"));
}
if (controlDict_.found("writeControl"))
@ -55,6 +55,15 @@ void Foam::Time::readDict()
if (controlDict_.readIfPresent("writeInterval", newWriteInterval))
{
if
(
writeControl_ == writeControl::runTime
|| writeControl_ == writeControl::adjustableRunTime
)
{
newWriteInterval = userTimeToTime(newWriteInterval);
}
if
(
writeControl_ == writeControl::timeStep
@ -120,7 +129,7 @@ void Foam::Time::readDict()
if (stopAt_ == stopAtControl::endTime)
{
controlDict_.lookup("endTime") >> endTime_;
endTime_ = userTimeToTime(controlDict_.lookup<scalar>("endTime"));
}
else
{
@ -132,7 +141,7 @@ void Foam::Time::readDict()
endTime_ = 0;
}
dimensionedScalar::name() = timeName(value());
dimensionedScalar::name() = timeName(timeToUserTime(value()));
if (controlDict_.found("writeVersion"))
{

View File

@ -1,8 +1,3 @@
engineTime/engineTime/engineTime.C
engineTime/engineTime/engineTimeNew.C
engineTime/freePiston/freePiston.C
engineTime/crankConRod/crankConRod.C
ignition/ignition.C
ignition/ignitionIO.C
ignition/ignitionSite.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,14 +24,15 @@ License
\*---------------------------------------------------------------------------*/
#include "engineMesh.H"
#include "dimensionedScalar.H"
#include "../OpenFOAM/lnInclude/engineTime.H"
#include "unitConversion.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(engineMesh, 0);
defineRunTimeSelectionTable(engineMesh, IOobject);
defineTypeNameAndDebug(engineMesh, 0);
defineRunTimeSelectionTable(engineMesh, IOobject);
}
@ -40,7 +41,26 @@ defineRunTimeSelectionTable(engineMesh, IOobject);
Foam::engineMesh::engineMesh(const IOobject& io)
:
fvMesh(io),
engineDB_(refCast<const engineTime>(time())),
dict_
(
IOobject
(
"engineGeometry",
time().constant(),
time(),
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
),
rpm_
(
refCast<const userTimes::engine>(time().userTime()).rpm()
),
conRodLength_("conRodLength", dimLength, dict_),
bore_("bore", dimLength, dict_),
stroke_("stroke", dimLength, dict_),
clearance_("clearance", dimLength, dict_),
pistonIndex_(-1),
linerIndex_(-1),
cylinderHeadIndex_(-1),
@ -131,4 +151,71 @@ Foam::engineMesh::engineMesh(const IOobject& io)
Foam::engineMesh::~engineMesh()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::engineMesh::theta() const
{
return time().userTimeValue();
}
Foam::scalar Foam::engineMesh::deltaTheta() const
{
return time().timeToUserTime(time().deltaTValue());
}
Foam::scalar Foam::engineMesh::pistonPosition(const scalar theta) const
{
return
(
conRodLength_.value()
+ stroke_.value()/2.0
+ clearance_.value()
)
- (
stroke_.value()*::cos(degToRad(theta))/2.0
+ ::sqrt
(
sqr(conRodLength_.value())
- sqr(stroke_.value()*::sin(degToRad(theta))/2.0)
)
);
}
Foam::dimensionedScalar Foam::engineMesh::pistonPosition() const
{
return dimensionedScalar
(
"pistonPosition",
dimLength,
pistonPosition(theta())
);
}
Foam::dimensionedScalar Foam::engineMesh::pistonDisplacement() const
{
return dimensionedScalar
(
"pistonDisplacement",
dimLength,
pistonPosition(theta() - deltaTheta()) - pistonPosition().value()
);
}
Foam::dimensionedScalar Foam::engineMesh::pistonSpeed() const
{
return dimensionedScalar
(
"pistonSpeed",
dimVelocity,
pistonDisplacement().value()/(time().deltaTValue() + vSmall)
);
}
// ************************************************************************* //

View File

@ -35,7 +35,6 @@ SourceFiles
#ifndef engineMesh_H
#define engineMesh_H
#include "engineTime.H"
#include "fvMesh.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
@ -57,7 +56,16 @@ protected:
// Protected data
const engineTime& engineDB_;
const IOdictionary dict_;
//- RPM
dimensionedScalar rpm_;
//- Optional engine geometry parameters
dimensionedScalar conRodLength_;
dimensionedScalar bore_;
dimensionedScalar stroke_;
dimensionedScalar clearance_;
label pistonIndex_;
label linerIndex_;
@ -112,6 +120,56 @@ public:
return true;
}
//- Return the engines current operating RPM
const dimensionedScalar& rpm() const
{
return rpm_;
}
//- Return the engines connecting-rod length
const dimensionedScalar& conRodLength() const
{
return conRodLength_;
}
//- Return the engines bore
const dimensionedScalar& bore() const
{
return bore_;
}
//- Return the engines stroke
const dimensionedScalar& stroke() const
{
return stroke_;
}
//- Return the engines clearance-gap
const dimensionedScalar& clearance() const
{
return clearance_;
}
//- Return current crank-angle
virtual scalar theta() const;
//- Return crank-angle increment
virtual scalar deltaTheta() const;
//- Calculate the piston position from the engine geometry
// and given crank angle.
scalar pistonPosition(const scalar theta) const;
//- Return current piston position
dimensionedScalar pistonPosition() const;
//- Return piston displacement for current time step
dimensionedScalar pistonDisplacement() const;
//- Return piston speed for current time step
dimensionedScalar pistonSpeed() const;
virtual void move() = 0;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -46,10 +46,10 @@ Foam::fvMotionSolverEngineMesh::fvMotionSolverEngineMesh(const IOobject& io)
motionSolver_
(
*this,
engineDB_.engineDict()
dict_
)
{
engineDB_.engineDict().readIfPresent("pistonLayers", pistonLayers_);
dict_.readIfPresent("pistonLayers", pistonLayers_);
}
@ -63,13 +63,13 @@ Foam::fvMotionSolverEngineMesh::~fvMotionSolverEngineMesh()
void Foam::fvMotionSolverEngineMesh::move()
{
scalar deltaZ = engineDB_.pistonDisplacement().value();
scalar deltaZ = pistonDisplacement().value();
Info<< "deltaZ = " << deltaZ << endl;
// Position of the top of the static mesh layers above the piston
scalar pistonPlusLayers = pistonPosition_.value() + pistonLayers_.value();
scalar pistonSpeed = deltaZ/engineDB_.deltaTValue();
scalar pistonSpeed = deltaZ/time().deltaTValue();
motionSolver_.pointMotionU().boundaryFieldRef()[pistonIndex_] ==
pistonSpeed;
@ -87,38 +87,8 @@ void Foam::fvMotionSolverEngineMesh::move()
}
motionSolver_.solve();
if (engineDB_.foundObject<surfaceScalarField>("phi"))
{
surfaceScalarField& phi =
engineDB_.lookupObjectRef<surfaceScalarField>("phi");
const volScalarField& rho =
engineDB_.lookupObject<volScalarField>("rho");
const volVectorField& U =
engineDB_.lookupObject<volVectorField>("U");
bool absolutePhi = false;
if (moving())
{
phi += fvc::interpolate(rho)*fvc::meshPhi(rho, U);
absolutePhi = true;
}
movePoints(motionSolver_.curPoints());
if (absolutePhi)
{
phi -= fvc::interpolate(rho)*fvc::meshPhi(rho, U);
}
}
else
{
movePoints(motionSolver_.curPoints());
}
pistonPosition_.value() += deltaZ;
Info<< "clearance: " << deckHeight_.value() - pistonPosition_.value() << nl

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,7 +44,7 @@ Foam::layeredEngineMesh::layeredEngineMesh(const IOobject& io)
engineMesh(io),
pistonLayers_("pistonLayers", dimLength, 0.0)
{
engineDB_.engineDict().readIfPresent("pistonLayers", pistonLayers_);
dict_.readIfPresent("pistonLayers", pistonLayers_);
}
@ -58,7 +58,7 @@ Foam::layeredEngineMesh::~layeredEngineMesh()
void Foam::layeredEngineMesh::move()
{
scalar deltaZ = engineDB_.pistonDisplacement().value();
scalar deltaZ = pistonDisplacement().value();
Info<< "deltaZ = " << deltaZ << endl;
// Position of the top of the static mesh layers above the piston
@ -83,38 +83,10 @@ void Foam::layeredEngineMesh::move()
}
}
if (engineDB_.foundObject<surfaceScalarField>("phi"))
{
surfaceScalarField& phi =
engineDB_.lookupObjectRef<surfaceScalarField>("phi");
const volScalarField& rho =
engineDB_.lookupObject<volScalarField>("rho");
const volVectorField& U =
engineDB_.lookupObject<volVectorField>("U");
bool absolutePhi = false;
if (moving())
{
phi += fvc::interpolate(rho)*fvc::meshPhi(rho, U);
absolutePhi = true;
}
movePoints(newPoints);
if (absolutePhi)
{
phi -= fvc::interpolate(rho)*fvc::meshPhi(rho, U);
}
}
else
{
movePoints(newPoints);
}
pistonPosition_.value() += deltaZ;
scalar pistonSpeed = deltaZ/engineDB_.deltaTValue();
scalar pistonSpeed = deltaZ/time().deltaTValue();
Info<< "clearance: " << deckHeight_.value() - pistonPosition_.value() << nl
<< "Piston speed = " << pistonSpeed << " m/s" << endl;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "enginePiston.H"
#include "engineTime.H"
#include "polyMesh.H"
#include "engineMesh.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -38,8 +37,7 @@ Foam::enginePiston::enginePiston
const scalar maxLayer
)
:
mesh_(mesh),
engineDB_(refCast<const engineTime>(mesh.time())),
mesh_(refCast<const engineMesh>(mesh)),
patchID_(pistonPatchName, mesh.boundaryMesh()),
csPtr_(pistonCS),
minLayer_(minLayer),
@ -53,8 +51,7 @@ Foam::enginePiston::enginePiston
const dictionary& dict
)
:
mesh_(mesh),
engineDB_(refCast<const engineTime>(mesh_.time())),
mesh_(refCast<const engineMesh>(mesh)),
patchID_(dict.lookup("patch"), mesh.boundaryMesh()),
csPtr_
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,8 +44,7 @@ namespace Foam
{
// Forward declaration of classes
class polyMesh;
class engineTime;
class engineMesh;
/*---------------------------------------------------------------------------*\
Class enginePiston Declaration
@ -56,10 +55,7 @@ class enginePiston
// Private Data
//- Reference to engine mesh
const polyMesh& mesh_;
//- Reference to engine database
const engineTime& engineDB_;
const engineMesh& mesh_;
//- Piston patch
polyPatchID patchID_;

View File

@ -1,177 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-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/>.
\*---------------------------------------------------------------------------*/
#include "crankConRod.H"
#include "../OpenFOAM/lnInclude/engineTime.H"
#include "unitConversion.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(crankConRod, 0);
addToRunTimeSelectionTable(engineTime, crankConRod, dictionary);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::crankConRod::timeAdjustment()
{
deltaT_ = degToTime(deltaT_);
endTime_ = degToTime(endTime_);
if
(
writeControl_ == writeControl::runTime
|| writeControl_ == writeControl::adjustableRunTime
)
{
writeInterval_ = degToTime(writeInterval_);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::crankConRod::crankConRod
(
const word& name,
const fileName& rootPath,
const fileName& caseName,
const fileName& systemName,
const fileName& constantName,
const fileName& dictName
)
:
engineTime
(
name,
rootPath,
caseName,
systemName,
constantName
),
rpm_
(
refCast<const userTimes::engine>(userTime()).rpm()
),
conRodLength_(dimensionedScalar("conRodLength", dimLength, 0)),
bore_(dimensionedScalar("bore", dimLength, 0)),
stroke_(dimensionedScalar("stroke", dimLength, 0)),
clearance_(dimensionedScalar("clearance", dimLength, 0))
{
// geometric parameters are not strictly required for Time
dict_.readIfPresent("conRodLength", conRodLength_);
dict_.readIfPresent("bore", bore_);
dict_.readIfPresent("stroke", stroke_);
dict_.readIfPresent("clearance", clearance_);
timeAdjustment();
startTime_ = degToTime(startTime_);
value() = degToTime(value());
deltaTSave_ = deltaT_;
deltaT0_ = deltaT_;
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::crankConRod::readDict()
{
Time::readDict();
timeAdjustment();
}
bool Foam::crankConRod::read()
{
if (Time::read())
{
timeAdjustment();
return true;
}
else
{
return false;
}
}
Foam::scalar Foam::crankConRod::degToTime(const scalar theta) const
{
// 6 * rpm => deg/s
return theta/(6.0*rpm_.value());
}
Foam::scalar Foam::crankConRod::timeToDeg(const scalar t) const
{
// 6 * rpm => deg/s
return t*(6.0*rpm_.value());
}
Foam::scalar Foam::crankConRod::theta() const
{
return timeToDeg(value());
}
Foam::word Foam::crankConRod::unit() const
{
return " CAD";
}
Foam::scalar Foam::crankConRod::deltaTheta() const
{
return timeToDeg(deltaTValue());
}
Foam::scalar Foam::crankConRod::pistonPosition(const scalar theta) const
{
return
(
conRodLength_.value()
+ stroke_.value()/2.0
+ clearance_.value()
)
- (
stroke_.value()*::cos(degToRad(theta))/2.0
+ ::sqrt
(
sqr(conRodLength_.value())
- sqr(stroke_.value()*::sin(degToRad(theta))/2.0)
)
);
}
// ************************************************************************* //

View File

@ -1,201 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-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/>.
Class
Foam::crankConRod
Description
Manage time in terms of engine RPM and crank-angle.
When crankConRod is in effect, the userTime is reported in degrees
crank-angle instead of in seconds. The RPM to be used is specified in
\c constant/engineGeometry. If only a time conversion is required,
the geometric engine parameters can be dropped or set to zero.
For example,
\verbatim
rpm rpm [0 0 -1 0 0] 2000;
conRodLength conRodLength [0 1 0 0 0] 0.0;
bore bore [0 1 0 0 0] 0.0;
stroke stroke [0 1 0 0 0] 0.0;
clearance clearance [0 1 0 0 0] 0.0;
\endverbatim
SourceFiles
crankConRod.C
\*---------------------------------------------------------------------------*/
#ifndef crankConRod_H
#define crankConRod_H
#include "engineTime.H"
#include "dictionary.H"
#include "dimensionedScalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class crankConRod Declaration
\*---------------------------------------------------------------------------*/
class crankConRod
:
public engineTime
{
// Private Data
//- RPM is required
dimensionedScalar rpm_;
//- Optional engine geometry parameters
dimensionedScalar conRodLength_;
dimensionedScalar bore_;
dimensionedScalar stroke_;
dimensionedScalar clearance_;
// Private Member Functions
//- Adjust read time values
void timeAdjustment();
public:
//- Runtime type information
TypeName("crankConRod");
// Constructors
//- Construct from objectRegistry arguments
crankConRod
(
const word& name,
const fileName& rootPath,
const fileName& caseName,
const fileName& systemName = "system",
const fileName& constantName = "constant",
const fileName& dictName = "engineGeometry"
);
//- Disallow default bitwise copy construction
crankConRod(const crankConRod&) = delete;
//- Destructor
virtual ~crankConRod()
{}
// Member Functions
// Conversion
//- Convert degrees to seconds (for given engine speed in RPM)
scalar degToTime(const scalar theta) const;
//- Convert seconds to degrees (for given engine speed in RPM)
scalar timeToDeg(const scalar t) const;
//- Calculate the piston position from the engine geometry
// and given crank angle.
scalar pistonPosition(const scalar theta) const;
// Access
//- Return the engines current operating RPM
const dimensionedScalar& rpm() const
{
return rpm_;
}
//- Return the engines connecting-rod length
const dimensionedScalar& conRodLength() const
{
return conRodLength_;
}
//- Return the engines bore
const dimensionedScalar& bore() const
{
return bore_;
}
//- Return the engines stroke
const dimensionedScalar& stroke() const
{
return stroke_;
}
//- Return the engines clearance-gap
const dimensionedScalar& clearance() const
{
return clearance_;
}
//- Return current crank-angle
virtual scalar theta() const;
//- Return time unit
virtual word unit() const;
//- Return crank-angle increment
virtual scalar deltaTheta() const;
// Member Functions overriding the virtual functions in time
//- Read the control dictionary and set the write controls etc.
virtual void readDict();
// Edit
//- Read the controlDict and set all the parameters
virtual bool read();
// Member Operators
//- Disallow default bitwise assignment
void operator=(const crankConRod&) = delete;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,126 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
\*---------------------------------------------------------------------------*/
#include "engineTime.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(engineTime, 0);
defineRunTimeSelectionTable(engineTime, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::engineTime::engineTime
(
const word& name,
const fileName& rootPath,
const fileName& caseName,
const fileName& systemName,
const fileName& constantName,
const fileName& dictName
)
:
Time
(
name,
rootPath,
caseName,
systemName,
constantName
),
dict_
(
IOobject
(
"engineGeometry",
constant(),
*this,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::engineTime::readDict()
{
Time::readDict();
}
bool Foam::engineTime::read()
{
if (Time::read())
{
return true;
}
else
{
return false;
}
}
Foam::dimensionedScalar Foam::engineTime::pistonPosition() const
{
return dimensionedScalar
(
"pistonPosition",
dimLength,
pistonPosition(theta())
);
}
Foam::dimensionedScalar Foam::engineTime::pistonDisplacement() const
{
return dimensionedScalar
(
"pistonDisplacement",
dimLength,
pistonPosition(theta() - deltaTheta()) - pistonPosition().value()
);
}
Foam::dimensionedScalar Foam::engineTime::pistonSpeed() const
{
return dimensionedScalar
(
"pistonSpeed",
dimVelocity,
pistonDisplacement().value()/(deltaTValue() + vSmall)
);
}
// ************************************************************************* //

View File

@ -1,177 +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/>.
Class
Foam::engineTime
Description
An abstract class for the time description of the piston motion
SourceFiles
engineTime.C
\*---------------------------------------------------------------------------*/
#ifndef engineTime0_H
#define engineTime0_H
#include "Time.H"
#include "IOdictionary.H"
#include "dimensionedScalar.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class engineTime Declaration
\*---------------------------------------------------------------------------*/
class engineTime
:
public Time
{
protected:
const IOdictionary dict_;
public:
//- Runtime type information
TypeName("engineTime");
//- Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
engineTime,
dictionary,
(
const word& name,
const fileName& rootPath,
const fileName& caseName,
const fileName& systemName,
const fileName& constantName,
const fileName& dictName
),
(name, rootPath, caseName, systemName, constantName, dictName)
);
// Constructors
//- Construct from objectRegistry arguments
engineTime
(
const word& name,
const fileName& rootPath,
const fileName& caseName,
const fileName& systemName = "system",
const fileName& constantName = "constant",
const fileName& dictName = "engineGeometry"
);
// Selector
static autoPtr<engineTime> New
(
const word& name,
const fileName& rootPath,
const fileName& globalCaseName,
const fileName& caseName,
const fileName& systemName = "system",
const fileName& constantName = "constant",
const fileName& dictName = "engineGeometry"
);
//- Destructor
virtual ~engineTime()
{}
// Member Functions
// Conversion
//- Calculate the piston position from the engine geometry
// and given time (CA or s)
virtual scalar pistonPosition(const scalar theta) const = 0;
// Access
//- Return the engine geometry dictionary
inline const IOdictionary& engineDict() const
{
return dict_;
}
//- Return current engine time
// (value might be expressed in CA or s depending on the model)
virtual scalar theta() const = 0;
//- Return time unit
virtual word unit() const = 0;
//- Return engine time increment
// (value might be expressed in CA or s depending on the model)
virtual scalar deltaTheta() const = 0;
//- Return current piston position
dimensionedScalar pistonPosition() const;
//- Return piston displacement for current time step
dimensionedScalar pistonDisplacement() const;
//- Return piston speed for current time step
dimensionedScalar pistonSpeed() const;
// Member Functions overriding the virtual functions in time
//- Read the control dictionary and set the write controls etc.
virtual void readDict();
// Edit
//- Read the controlDict and set all the parameters
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,81 +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/>.
\*---------------------------------------------------------------------------*/
#include "engineTime.H"
#include "IFstream.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::engineTime> Foam::engineTime::New
(
const word& name,
const fileName& rootPath,
const fileName& globalCaseName,
const fileName& caseName,
const fileName& systemName,
const fileName& constantName,
const fileName& dictName
)
{
IFstream engineDictFile(rootPath/globalCaseName/constantName/dictName);
dictionary engineDict(engineDictFile);
const word engineType
(
engineDict.lookupOrDefault<word>("engineType", "crankConRod")
);
Info<< "Selecting engine type " << engineType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(engineType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown engine type "
<< engineType << nl << nl
<< "Valid engine types are :" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<engineTime>
(
cstrIter()
(
name,
rootPath,
caseName,
systemName,
constantName,
dictName
)
);
}
// ************************************************************************* //

View File

@ -1,91 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 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/>.
\*---------------------------------------------------------------------------*/
#include "freePiston.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(freePiston, 0);
addToRunTimeSelectionTable(engineTime, freePiston, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::freePiston::freePiston
(
const word& name,
const fileName& rootPath,
const fileName& caseName,
const fileName& systemName,
const fileName& constantName,
const fileName& dictName
)
:
engineTime
(
name,
rootPath,
caseName,
systemName,
constantName
),
pistonPositionTime_
(
Function1<scalar>::New("pistonPositionTime", dict_)
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::freePiston::theta() const
{
return value();
}
Foam::word Foam::freePiston::unit() const
{
return " s";
}
Foam::scalar Foam::freePiston::deltaTheta() const
{
return deltaTValue();
}
Foam::scalar Foam::freePiston::pistonPosition(const scalar theta) const
{
return pistonPositionTime_->value(theta);
}
// ************************************************************************* //

View File

@ -1,146 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2020 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/>.
Class
Foam::freePiston
Description
In case of free pistons, the piston position is determined by a user-defined
position according to time.
The piston trajectory is specified in \c constant/engineGeometry using a
table or a separated file. The position is relative to the cylinder head,
i.e. decreasing when compressing.
For example,
\verbatim
pistonPositionTime table ( (0 0.13) (0.020 0.03) );
\endverbatim
or from a file
\verbatim
pistonPositionTime table;
pistonPositionTimeCoeffs
{
file "data";
outOfBounds clamp;
interpolationScheme linear;
}
\endverbatim
SourceFiles
freePiston.C
\*---------------------------------------------------------------------------*/
#ifndef freePiston_H
#define freePiston_H
#include "engineTime.H"
#include "dictionary.H"
#include "dimensionedScalar.H"
#include "Function1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class freePiston Declaration
\*---------------------------------------------------------------------------*/
class freePiston
:
public engineTime
{
// Private Data
autoPtr<Function1<scalar>> pistonPositionTime_;
public:
//- Runtime type information
TypeName("freePiston");
// Constructors
//- Construct from objectRegistry arguments
freePiston
(
const word& name,
const fileName& rootPath,
const fileName& caseName,
const fileName& systemName = "system",
const fileName& constantName = "constant",
const fileName& dictName = "engineGeometry"
);
//- Disallow default bitwise copy construction
freePiston(const freePiston&) = delete;
//- Destructor
virtual ~freePiston()
{}
// Member Functions
// Conversion
//- Calculate the piston position from the engine geometry
// and given crank angle.
scalar pistonPosition(const scalar theta) const;
// Access
//- Return current engine time
virtual scalar theta() const;
//- Return time unit
virtual word unit() const;
//- Return engine time increment
virtual scalar deltaTheta() const;
// Member Operators
//- Disallow default bitwise assignment
void operator=(const freePiston&) = delete;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "engineValve.H"
#include "engineTime.H"
#include "engineMesh.H"
#include "polyMesh.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -85,8 +85,7 @@ Foam::engineValve::engineValve
)
:
name_(name),
mesh_(mesh),
engineDB_(refCast<const engineTime>(mesh.time())),
mesh_(refCast<const engineMesh>(mesh)),
csPtr_(valveCS),
bottomPatch_(bottomPatchName, mesh.boundaryMesh()),
poppetPatch_(poppetPatchName, mesh.boundaryMesh()),
@ -116,8 +115,7 @@ Foam::engineValve::engineValve
)
:
name_(name),
mesh_(mesh),
engineDB_(refCast<const engineTime>(mesh_.time())),
mesh_(refCast<const engineMesh>(mesh)),
csPtr_
(
coordinateSystem::New
@ -172,7 +170,7 @@ Foam::scalar Foam::engineValve::lift(const scalar theta) const
bool Foam::engineValve::isOpen() const
{
return lift(engineDB_.theta()) >= minLift_;
return lift(mesh_.theta()) >= minLift_;
}
@ -180,7 +178,7 @@ Foam::scalar Foam::engineValve::curLift() const
{
return max
(
lift(engineDB_.theta()),
lift(mesh_.theta()),
minLift_
);
}
@ -193,10 +191,10 @@ Foam::scalar Foam::engineValve::curVelocity() const
curLift()
- max
(
lift(engineDB_.theta() - engineDB_.deltaTheta()),
lift(mesh_.theta() - mesh_.deltaTheta()),
minLift_
)
)/(engineDB_.deltaTValue() + vSmall);
)/(mesh_.time().deltaTValue() + vSmall);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -46,8 +46,7 @@ namespace Foam
{
// Forward declaration of classes
class polyMesh;
class engineTime;
class engineMesh;
/*---------------------------------------------------------------------------*\
Class engineValve Declaration
@ -61,10 +60,7 @@ class engineValve
word name_;
//- Reference to engine mesh
const polyMesh& mesh_;
//- Reference to engine database
const engineTime& engineDB_;
const engineMesh& mesh_;
//- Coordinate system
autoPtr<coordinateSystem> csPtr_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -68,9 +68,6 @@ public:
//- Construct from Istream and database
ignition(const dictionary&, const Time&, const fvMesh&);
//- Construct from Istream and engineTime
ignition(const dictionary&, const engineTime&, const fvMesh&);
//- Disallow default bitwise copy construction
ignition(const ignition&) = delete;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include "engineTime.H"
#include "Time.H"
#include "ignition.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -54,30 +54,4 @@ Foam::ignition::ignition
}
Foam::ignition::ignition
(
const dictionary& combustionProperties,
const engineTime& edb,
const fvMesh& mesh
)
:
mesh_(mesh),
ignite_(combustionProperties.lookup("ignite")),
ignSites_
(
combustionProperties.lookup("ignitionSites"),
ignitionSite::iNew(edb, mesh)
)
{
if (ignite_)
{
Info<< "\nIgnition on" << endl;
}
else
{
Info<< "\nIgnition switched off" << endl;
}
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,7 +49,6 @@ namespace Foam
{
class Time;
class engineTime;
class fvMesh;
/*---------------------------------------------------------------------------*\
@ -115,9 +114,6 @@ public:
//- Construct from Istream and database
ignitionSite(Istream&, const Time&, const fvMesh&);
//- Construct from Istream and engineTime
ignitionSite(Istream&, const engineTime&, const fvMesh&);
//- Copy constructor
ignitionSite(const ignitionSite&) = default;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "ignitionSite.H"
#include "engineTime.H"
#include "Time.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -64,40 +64,4 @@ Foam::ignitionSite::ignitionSite
}
Foam::ignitionSite::ignitionSite
(
Istream& is,
const engineTime& edb,
const fvMesh& mesh
)
:
db_(edb),
mesh_(mesh),
ignitionSiteDict_(is),
location_(ignitionSiteDict_.lookup("location")),
diameter_(ignitionSiteDict_.lookup<scalar>("diameter")),
time_
(
db_.userTimeToTime
(
edb.userTimeToTime(ignitionSiteDict_.lookup<scalar>("start"))
)
),
duration_
(
db_.userTimeToTime
(
edb.userTimeToTime(ignitionSiteDict_.lookup<scalar>("duration"))
)
),
strength_(ignitionSiteDict_.lookup<scalar>("strength")),
timeIndex_(db_.timeIndex())
{
// Check state of Istream
is.check("ignitionSite::ignitionSite(Istream&)");
findIgnitionCells(mesh_);
}
// ************************************************************************* //

View File

@ -1,14 +0,0 @@
Info<< "Create engine time\n" << endl;
autoPtr<engineTime> runTimePtr
(
engineTime::New
(
Time::controlDictName,
args.rootPath(),
args.globalCaseName(),
args.caseName()
)
);
engineTime& runTime = runTimePtr();