fvMeshMovers::engine: Moved and updated enginePiston and engineValve from src/engine

This commit is contained in:
Henry Weller
2021-11-07 19:08:43 +00:00
parent 43f8daf1a7
commit 49faf0be14
15 changed files with 56 additions and 781 deletions

View File

@ -1,11 +1,3 @@
ignition/ignition.C
ignition/ignitionIO.C
ignition/ignitionSite.C
ignition/ignitionSiteIO.C
engineValve/engineValve.C
enginePiston/enginePiston.C
engineMesh/engineMesh/engineMesh.C
engineMesh/engineMesh/engineMeshNew.C
engineMesh/layeredEngineMesh/layeredEngineMesh.C

View File

@ -1,74 +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 "ignition.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::ignition::igniting() const
{
if (!ignite())
{
return false;
}
bool igning = false;
forAll(ignSites_, i)
{
if (ignSites_[i].igniting())
{
igning = true;
}
}
return igning;
}
bool Foam::ignition::ignited() const
{
if (!ignite())
{
return false;
}
bool igned = false;
forAll(ignSites_, i)
{
if (ignSites_[i].ignited())
{
igned = true;
}
}
return igned;
}
// ************************************************************************* //

View File

@ -1,113 +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::ignition
Description
Foam::ignition
SourceFiles
ignition.C
ignitionIO.C
\*---------------------------------------------------------------------------*/
#ifndef ignition_H
#define ignition_H
#include "ignitionSite.H"
#include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class fvMesh;
/*---------------------------------------------------------------------------*\
Class ignition Declaration
\*---------------------------------------------------------------------------*/
class ignition
{
// Private Data
const fvMesh& mesh_;
Switch ignite_;
PtrList<ignitionSite> ignSites_;
public:
// Constructors
//- Construct from Istream and database
ignition(const dictionary&, const Time&, const fvMesh&);
//- Disallow default bitwise copy construction
ignition(const ignition&) = delete;
// Member Functions
//- Return the set of ignition sites
const PtrList<ignitionSite>& sites()
{
return ignSites_;
}
// Check
bool ignite() const
{
return ignite_;
}
//- Are any of the ignition site currently igniting
bool igniting() const;
//- Has the mixture been ignited?
bool ignited() const;
// Member Operators
//- Disallow default bitwise assignment
void operator=(const ignition&) = delete;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,57 +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 "Time.H"
#include "ignition.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::ignition::ignition
(
const dictionary& combustionProperties,
const Time& db,
const fvMesh& mesh
)
:
mesh_(mesh),
ignite_(combustionProperties.lookup("ignite")),
ignSites_
(
combustionProperties.lookup("ignitionSites"),
ignitionSite::iNew(db, mesh)
)
{
if (ignite_)
{
Info<< "\nIgnition on" << endl;
}
else
{
Info<< "\nIgnition switched off" << endl;
}
}
// ************************************************************************* //

View File

@ -1,135 +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 "ignitionSite.H"
#include "Time.H"
#include "volFields.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::ignitionSite::findIgnitionCells(const fvMesh& mesh)
{
// Bit tricky: generate C and V before shortcutting if cannot find
// cell locally. mesh.C generation uses parallel communication.
const volVectorField& centres = mesh.C();
const scalarField& vols = mesh.V();
label ignCell = mesh.findCell(location_);
if (ignCell == -1)
{
return;
}
scalar radius = diameter_/2.0;
cells_.setSize(1);
cellVolumes_.setSize(1);
cells_[0] = ignCell;
cellVolumes_[0] = vols[ignCell];
scalar minDist = great;
label nIgnCells = 1;
forAll(centres, celli)
{
scalar dist = mag(centres[celli] - location_);
if (dist < minDist)
{
minDist = dist;
}
if (dist < radius && celli != ignCell)
{
cells_.setSize(nIgnCells+1);
cellVolumes_.setSize(nIgnCells+1);
cells_[nIgnCells] = celli;
cellVolumes_[nIgnCells] = vols[celli];
nIgnCells++;
}
}
if (cells_.size())
{
Pout<< "Found ignition cells:" << endl << cells_ << endl;
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::labelList& Foam::ignitionSite::cells() const
{
if (mesh_.changing() && timeIndex_ != db_.timeIndex())
{
const_cast<ignitionSite&>(*this).findIgnitionCells(mesh_);
}
timeIndex_ = db_.timeIndex();
return cells_;
}
bool Foam::ignitionSite::igniting() const
{
scalar curTime = db_.value();
scalar deltaT = db_.deltaTValue();
return
(
(curTime - deltaT >= time_)
&&
(curTime - deltaT < time_ + max(duration_, deltaT) + small)
);
}
bool Foam::ignitionSite::ignited() const
{
scalar curTime = db_.value();
scalar deltaT = db_.deltaTValue();
return(curTime - deltaT >= time_);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
void Foam::ignitionSite::operator=(const ignitionSite& is)
{
location_ = is.location_;
diameter_ = is.diameter_;
time_ = is.time_;
duration_ = is.duration_;
strength_ = is.strength_;
cells_ = is.cells_;
cellVolumes_ = is.cellVolumes_;
}
// ************************************************************************* //

View File

@ -1,186 +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::ignitionSite
Description
Foam::ignitionSite
SourceFiles
ignitionSiteI.H
ignitionSite.C
ignitionSiteIO.C
\*---------------------------------------------------------------------------*/
#ifndef ignitionSite_H
#define ignitionSite_H
#include "vector.H"
#include "labelList.H"
#include "scalarList.H"
#include "autoPtr.H"
#include "dictionary.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class Time;
class fvMesh;
/*---------------------------------------------------------------------------*\
Class ignitionSite Declaration
\*---------------------------------------------------------------------------*/
class ignitionSite
{
// Private Data
const Time& db_;
const fvMesh& mesh_;
dictionary ignitionSiteDict_;
vector location_;
scalar diameter_;
scalar time_;
scalar duration_;
scalar strength_;
labelList cells_;
scalarList cellVolumes_;
//- Current time index.
// Used during the update for moving meshes
mutable label timeIndex_;
// Private Member Functions
void findIgnitionCells(const fvMesh&);
public:
// Public classes
//- Class used for the read-construction of
// PtrLists of ignitionSite
class iNew
{
const Time& db_;
const fvMesh& mesh_;
public:
iNew(const Time& db, const fvMesh& mesh)
:
db_(db),
mesh_(mesh)
{}
autoPtr<ignitionSite> operator()(Istream& is) const
{
return autoPtr<ignitionSite>(new ignitionSite(is, db_, mesh_));
}
};
// Constructors
//- Construct from Istream and database
ignitionSite(Istream&, const Time&, const fvMesh&);
//- Copy constructor
ignitionSite(const ignitionSite&) = default;
//- Clone
autoPtr<ignitionSite> clone() const
{
return autoPtr<ignitionSite>(new ignitionSite(*this));
}
// Member Functions
// Access
const vector& location() const
{
return location_;
}
scalar diameter() const
{
return diameter_;
}
scalar time() const
{
return time_;
}
scalar duration() const
{
return duration_;
}
scalar strength() const
{
return strength_;
}
//- Return the ignition cells updated if the mesh moved
const labelList& cells() const;
const scalarList& cellVolumes() const
{
return cellVolumes_;
}
// Check
bool igniting() const;
bool ignited() const;
// Member Operators
void operator=(const ignitionSite&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,67 +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 "ignitionSite.H"
#include "Time.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::ignitionSite::ignitionSite
(
Istream& is,
const Time& db,
const fvMesh& mesh
)
:
db_(db),
mesh_(mesh),
ignitionSiteDict_(is),
location_(ignitionSiteDict_.lookup("location")),
diameter_(ignitionSiteDict_.lookup<scalar>("diameter")),
time_
(
db_.userTimeToTime
(
ignitionSiteDict_.lookup<scalar>("start")
)
),
duration_
(
db_.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,87 +0,0 @@
dimensionedScalar StCorr("StCorr", dimless, 1.0);
if (ign.igniting())
{
// Calculate volume of ignition kernel
dimensionedScalar Vk("Vk", dimVolume, gSum(c*mesh.V().field()));
dimensionedScalar Ak("Ak", dimArea, 0.0);
if (Vk.value() > small)
{
// Calculate kernel area from its volume
// and the dimensionality of the case
switch(mesh.nGeometricD())
{
case 3:
{
// Assume it is part-spherical
scalar sphereFraction
(
combustionProperties.lookup<scalar>
(
"ignitionSphereFraction"
)
);
Ak = sphereFraction*4.0*constant::mathematical::pi
*pow
(
3.0*Vk
/(sphereFraction*4.0*constant::mathematical::pi),
2.0/3.0
);
}
break;
case 2:
{
// Assume it is part-circular
dimensionedScalar thickness
(
combustionProperties.lookup("ignitionThickness")
);
scalar circleFraction
(
combustionProperties.lookup<scalar>
(
"ignitionCircleFraction"
)
);
Ak = circleFraction*constant::mathematical::pi*thickness
*sqrt
(
4.0*Vk
/(
circleFraction
*thickness
*constant::mathematical::pi
)
);
}
break;
case 1:
// Assume it is plane or two planes
Ak = dimensionedScalar
(
combustionProperties.lookup("ignitionKernelArea")
);
break;
}
// Calculate kernel area from b field consistent with the
// discretisation of the b equation.
const volScalarField mgb
(
fvc::div(nf, b, "div(phiSt,b)") - b*fvc::div(nf) + dMgb
);
dimensionedScalar AkEst = gSum(mgb*mesh.V().field());
StCorr.value() = max(min((Ak/AkEst).value(), 10.0), 1.0);
Info<< "StCorr = " << StCorr.value() << endl;
}
}

View File

@ -3,5 +3,7 @@ interpolator/fvMeshMoversInterpolator.C
inkJet/fvMeshMoversInkJet.C
engine/engine/fvMeshMoversEngine.C
engine/layered/fvMeshMoversLayeredEngine.C
engine/engineValve/engineValve.C
engine/enginePiston/enginePiston.C
LIB = $(FOAM_LIBBIN)/libfvMeshMovers

View File

@ -1,7 +1,9 @@
EXE_INC = \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
LIB_LIBS = \
-ldynamicMesh \
-lfiniteVolume
-lfiniteVolume \
-lmeshTools

View File

@ -24,21 +24,20 @@ License
\*---------------------------------------------------------------------------*/
#include "enginePiston.H"
#include "engineMesh.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::enginePiston::enginePiston
(
const polyMesh& mesh,
const fvMeshMover& meshMover,
const word& pistonPatchName,
const autoPtr<coordinateSystem>& pistonCS,
const scalar minLayer,
const scalar maxLayer
)
:
mesh_(refCast<const engineMesh>(mesh)),
patchID_(pistonPatchName, mesh.boundaryMesh()),
meshMover_(refCast<const fvMeshMovers::engine>(meshMover)),
patchID_(pistonPatchName, meshMover_.mesh().boundaryMesh()),
csPtr_(pistonCS),
minLayer_(minLayer),
maxLayer_(maxLayer)
@ -47,17 +46,17 @@ Foam::enginePiston::enginePiston
Foam::enginePiston::enginePiston
(
const polyMesh& mesh,
const fvMeshMover& meshMover,
const dictionary& dict
)
:
mesh_(refCast<const engineMesh>(mesh)),
patchID_(dict.lookup("patch"), mesh.boundaryMesh()),
meshMover_(refCast<const fvMeshMovers::engine>(meshMover)),
patchID_(dict.lookup("patch"), meshMover_.mesh().boundaryMesh()),
csPtr_
(
coordinateSystem::New
(
mesh_,
meshMover_.mesh(),
dict.subDict("coordinateSystem")
)
),

View File

@ -35,6 +35,7 @@ SourceFiles
#ifndef enginePiston_H
#define enginePiston_H
#include "fvMeshMoversEngine.H"
#include "polyPatchID.H"
#include "coordinateSystem.H"
@ -43,9 +44,6 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
class engineMesh;
/*---------------------------------------------------------------------------*\
Class enginePiston Declaration
\*---------------------------------------------------------------------------*/
@ -54,8 +52,8 @@ class enginePiston
{
// Private Data
//- Reference to engine mesh
const engineMesh& mesh_;
//- Reference to engine mesh mover
const fvMeshMovers::engine& meshMover_;
//- Piston patch
polyPatchID patchID_;
@ -75,15 +73,12 @@ class enginePiston
public:
// Static Data Members
// Constructors
//- Construct from components
enginePiston
(
const polyMesh& mesh,
const fvMeshMover& meshMover,
const word& pistonPatchName,
const autoPtr<coordinateSystem>& pistonCS,
const scalar minLayer,
@ -94,7 +89,7 @@ public:
//- Construct from dictionary
enginePiston
(
const polyMesh& mesh,
const fvMeshMover& meshMover,
const dictionary& dict
);

View File

@ -24,8 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "engineValve.H"
#include "engineMesh.H"
#include "polyMesh.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -65,7 +63,7 @@ Foam::scalar Foam::engineValve::adjustCrankAngle(const scalar theta) const
Foam::engineValve::engineValve
(
const word& name,
const polyMesh& mesh,
const fvMeshMover& meshMover,
const autoPtr<coordinateSystem>& valveCS,
const word& bottomPatchName,
const word& poppetPatchName,
@ -85,15 +83,24 @@ Foam::engineValve::engineValve
)
:
name_(name),
mesh_(refCast<const engineMesh>(mesh)),
meshMover_(refCast<const fvMeshMovers::engine>(meshMover)),
csPtr_(valveCS),
bottomPatch_(bottomPatchName, mesh.boundaryMesh()),
poppetPatch_(poppetPatchName, mesh.boundaryMesh()),
stemPatch_(stemPatchName, mesh.boundaryMesh()),
curtainInPortPatch_(curtainInPortPatchName, mesh.boundaryMesh()),
curtainInCylinderPatch_(curtainInCylinderPatchName, mesh.boundaryMesh()),
detachInCylinderPatch_(detachInCylinderPatchName, mesh.boundaryMesh()),
detachInPortPatch_(detachInPortPatchName, mesh.boundaryMesh()),
bottomPatch_(bottomPatchName, meshMover_.mesh().boundaryMesh()),
poppetPatch_(poppetPatchName, meshMover_.mesh().boundaryMesh()),
stemPatch_(stemPatchName, meshMover_.mesh().boundaryMesh()),
curtainInPortPatch_
(
curtainInPortPatchName, meshMover_.mesh().boundaryMesh()
),
curtainInCylinderPatch_
(
curtainInCylinderPatchName, meshMover_.mesh().boundaryMesh()
),
detachInCylinderPatch_
(
detachInCylinderPatchName, meshMover_.mesh().boundaryMesh()
),
detachInPortPatch_(detachInPortPatchName, meshMover_.mesh().boundaryMesh()),
detachFaces_(detachFaces),
liftProfile_(liftProfile),
liftProfileStart_(min(liftProfile_.x())),
@ -110,42 +117,42 @@ Foam::engineValve::engineValve
Foam::engineValve::engineValve
(
const word& name,
const polyMesh& mesh,
const fvMeshMover& meshMover,
const dictionary& dict
)
:
name_(name),
mesh_(refCast<const engineMesh>(mesh)),
meshMover_(refCast<const fvMeshMovers::engine>(meshMover)),
csPtr_
(
coordinateSystem::New
(
mesh_,
meshMover_.mesh(),
dict.subDict("coordinateSystem")
)
),
bottomPatch_(dict.lookup("bottomPatch"), mesh.boundaryMesh()),
poppetPatch_(dict.lookup("poppetPatch"), mesh.boundaryMesh()),
stemPatch_(dict.lookup("stemPatch"), mesh.boundaryMesh()),
bottomPatch_(dict.lookup("bottomPatch"), meshMover_.mesh().boundaryMesh()),
poppetPatch_(dict.lookup("poppetPatch"), meshMover_.mesh().boundaryMesh()),
stemPatch_(dict.lookup("stemPatch"), meshMover_.mesh().boundaryMesh()),
curtainInPortPatch_
(
dict.lookup("curtainInPortPatch"),
mesh.boundaryMesh()
meshMover_.mesh().boundaryMesh()
),
curtainInCylinderPatch_
(
dict.lookup("curtainInCylinderPatch"),
mesh.boundaryMesh()
meshMover_.mesh().boundaryMesh()
),
detachInCylinderPatch_
(
dict.lookup("detachInCylinderPatch"),
mesh.boundaryMesh()
meshMover_.mesh().boundaryMesh()
),
detachInPortPatch_
(
dict.lookup("detachInPortPatch"),
mesh.boundaryMesh()
meshMover_.mesh().boundaryMesh()
),
detachFaces_(dict.lookup("detachFaces")),
liftProfile_("liftProfile", dict),
@ -170,7 +177,7 @@ Foam::scalar Foam::engineValve::lift(const scalar theta) const
bool Foam::engineValve::isOpen() const
{
return lift(mesh_.theta()) >= minLift_;
return lift(meshMover_.theta()) >= minLift_;
}
@ -178,7 +185,7 @@ Foam::scalar Foam::engineValve::curLift() const
{
return max
(
lift(mesh_.theta()),
lift(meshMover_.theta()),
minLift_
);
}
@ -191,10 +198,10 @@ Foam::scalar Foam::engineValve::curVelocity() const
curLift()
- max
(
lift(mesh_.theta() - mesh_.deltaTheta()),
lift(meshMover_.theta() - meshMover_.deltaTheta()),
minLift_
)
)/(mesh_.time().deltaTValue() + vSmall);
)/(meshMover_.mesh().time().deltaTValue() + vSmall);
}

View File

@ -35,7 +35,7 @@ SourceFiles
#ifndef engineValve_H
#define engineValve_H
#include "word.H"
#include "fvMeshMoversEngine.H"
#include "coordinateSystem.H"
#include "polyPatchID.H"
#include "Table.H"
@ -45,9 +45,6 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
class engineMesh;
/*---------------------------------------------------------------------------*\
Class engineValve Declaration
\*---------------------------------------------------------------------------*/
@ -59,8 +56,8 @@ class engineValve
//- Name of valve
word name_;
//- Reference to engine mesh
const engineMesh& mesh_;
//- Reference to engine mesh mover
const fvMeshMovers::engine& meshMover_;
//- Coordinate system
autoPtr<coordinateSystem> csPtr_;
@ -141,7 +138,7 @@ public:
engineValve
(
const word& name,
const polyMesh& mesh,
const fvMeshMover& meshMover,
const autoPtr<coordinateSystem>& valveCS,
const word& bottomPatchName,
const word& poppetPatchName,
@ -165,7 +162,7 @@ public:
engineValve
(
const word& name,
const polyMesh& mesh,
const fvMeshMover& meshMover,
const dictionary& dict
);

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