diff --git a/src/engine/Make/files b/src/engine/Make/files index 859a9576bb..995e3db325 100644 --- a/src/engine/Make/files +++ b/src/engine/Make/files @@ -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 diff --git a/src/engine/ignition/ignition.C b/src/engine/ignition/ignition.C deleted file mode 100644 index 450131827d..0000000000 --- a/src/engine/ignition/ignition.C +++ /dev/null @@ -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 . - -\*---------------------------------------------------------------------------*/ - -#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; -} - - -// ************************************************************************* // diff --git a/src/engine/ignition/ignition.H b/src/engine/ignition/ignition.H deleted file mode 100644 index 8491dc324c..0000000000 --- a/src/engine/ignition/ignition.H +++ /dev/null @@ -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 . - -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 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& 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 - -// ************************************************************************* // diff --git a/src/engine/ignition/ignitionIO.C b/src/engine/ignition/ignitionIO.C deleted file mode 100644 index 7aa88374fd..0000000000 --- a/src/engine/ignition/ignitionIO.C +++ /dev/null @@ -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 . - -\*---------------------------------------------------------------------------*/ - -#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; - } -} - - -// ************************************************************************* // diff --git a/src/engine/ignition/ignitionSite.C b/src/engine/ignition/ignitionSite.C deleted file mode 100644 index 21211ec1ad..0000000000 --- a/src/engine/ignition/ignitionSite.C +++ /dev/null @@ -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 . - -\*---------------------------------------------------------------------------*/ - -#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(*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_; -} - - -// ************************************************************************* // diff --git a/src/engine/ignition/ignitionSite.H b/src/engine/ignition/ignitionSite.H deleted file mode 100644 index 94eefec4b6..0000000000 --- a/src/engine/ignition/ignitionSite.H +++ /dev/null @@ -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 . - -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 operator()(Istream& is) const - { - return autoPtr(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 clone() const - { - return autoPtr(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 - -// ************************************************************************* // diff --git a/src/engine/ignition/ignitionSiteIO.C b/src/engine/ignition/ignitionSiteIO.C deleted file mode 100644 index 5d6212af85..0000000000 --- a/src/engine/ignition/ignitionSiteIO.C +++ /dev/null @@ -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 . - -\*---------------------------------------------------------------------------*/ - -#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("diameter")), - time_ - ( - db_.userTimeToTime - ( - ignitionSiteDict_.lookup("start") - ) - ), - duration_ - ( - db_.userTimeToTime - ( - ignitionSiteDict_.lookup("duration") - ) - ), - strength_(ignitionSiteDict_.lookup("strength")), - timeIndex_(db_.timeIndex()) -{ - // Check state of Istream - is.check("ignitionSite::ignitionSite(Istream&)"); - - findIgnitionCells(mesh_); -} - - -// ************************************************************************* // diff --git a/src/engine/include/StCorr.H b/src/engine/include/StCorr.H deleted file mode 100644 index 364279b81d..0000000000 --- a/src/engine/include/StCorr.H +++ /dev/null @@ -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 - ( - "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 - ( - "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; - } - } diff --git a/src/fvMeshMovers/Make/files b/src/fvMeshMovers/Make/files index e82a6cdfb7..d79c14c3e5 100644 --- a/src/fvMeshMovers/Make/files +++ b/src/fvMeshMovers/Make/files @@ -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 diff --git a/src/fvMeshMovers/Make/options b/src/fvMeshMovers/Make/options index 6e0fa932ab..4f7629e350 100644 --- a/src/fvMeshMovers/Make/options +++ b/src/fvMeshMovers/Make/options @@ -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 diff --git a/src/engine/enginePiston/enginePiston.C b/src/fvMeshMovers/engine/enginePiston/enginePiston.C similarity index 86% rename from src/engine/enginePiston/enginePiston.C rename to src/fvMeshMovers/engine/enginePiston/enginePiston.C index b32bb7fc0d..f8450ec6c5 100644 --- a/src/engine/enginePiston/enginePiston.C +++ b/src/fvMeshMovers/engine/enginePiston/enginePiston.C @@ -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& pistonCS, const scalar minLayer, const scalar maxLayer ) : - mesh_(refCast(mesh)), - patchID_(pistonPatchName, mesh.boundaryMesh()), + meshMover_(refCast(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(mesh)), - patchID_(dict.lookup("patch"), mesh.boundaryMesh()), + meshMover_(refCast(meshMover)), + patchID_(dict.lookup("patch"), meshMover_.mesh().boundaryMesh()), csPtr_ ( coordinateSystem::New ( - mesh_, + meshMover_.mesh(), dict.subDict("coordinateSystem") ) ), diff --git a/src/engine/enginePiston/enginePiston.H b/src/fvMeshMovers/engine/enginePiston/enginePiston.H similarity index 94% rename from src/engine/enginePiston/enginePiston.H rename to src/fvMeshMovers/engine/enginePiston/enginePiston.H index 8e0fed19cf..e30f9c7991 100644 --- a/src/engine/enginePiston/enginePiston.H +++ b/src/fvMeshMovers/engine/enginePiston/enginePiston.H @@ -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& pistonCS, const scalar minLayer, @@ -94,7 +89,7 @@ public: //- Construct from dictionary enginePiston ( - const polyMesh& mesh, + const fvMeshMover& meshMover, const dictionary& dict ); diff --git a/src/engine/engineValve/engineValve.C b/src/fvMeshMovers/engine/engineValve/engineValve.C similarity index 81% rename from src/engine/engineValve/engineValve.C rename to src/fvMeshMovers/engine/engineValve/engineValve.C index ee5086f24c..edd2efddc5 100644 --- a/src/engine/engineValve/engineValve.C +++ b/src/fvMeshMovers/engine/engineValve/engineValve.C @@ -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& valveCS, const word& bottomPatchName, const word& poppetPatchName, @@ -85,15 +83,24 @@ Foam::engineValve::engineValve ) : name_(name), - mesh_(refCast(mesh)), + meshMover_(refCast(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(mesh)), + meshMover_(refCast(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); } diff --git a/src/engine/engineValve/engineValve.H b/src/fvMeshMovers/engine/engineValve/engineValve.H similarity index 97% rename from src/engine/engineValve/engineValve.H rename to src/fvMeshMovers/engine/engineValve/engineValve.H index 17acb83888..c80532a945 100644 --- a/src/engine/engineValve/engineValve.H +++ b/src/fvMeshMovers/engine/engineValve/engineValve.H @@ -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 csPtr_; @@ -141,7 +138,7 @@ public: engineValve ( const word& name, - const polyMesh& mesh, + const fvMeshMover& meshMover, const autoPtr& 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 ); diff --git a/src/engine/engineValve/valveBank.H b/src/fvMeshMovers/engine/engineValve/valveBank.H similarity index 97% rename from src/engine/engineValve/valveBank.H rename to src/fvMeshMovers/engine/engineValve/valveBank.H index b212e10a21..279273e63c 100644 --- a/src/engine/engineValve/valveBank.H +++ b/src/fvMeshMovers/engine/engineValve/valveBank.H @@ -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