Loading...
Searching...
No Matches
enginePiston.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2013 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
29#include "engineTime.H"
30#include "polyMesh.H"
31#include "interpolateXY.H"
32
33// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34
35Foam::enginePiston::enginePiston
36(
37 const polyMesh& mesh,
38 const word& pistonPatchName,
39 const autoPtr<coordinateSystem>& pistonCS,
40 const scalar minLayer,
41 const scalar maxLayer
42)
43:
44 mesh_(mesh),
45 engineDB_(refCast<const engineTime>(mesh.time())),
46 patchID_(pistonPatchName, mesh.boundaryMesh()),
47 csysPtr_(pistonCS),
48 minLayer_(minLayer),
49 maxLayer_(maxLayer)
50{}
51
52
53Foam::enginePiston::enginePiston
54(
55 const polyMesh& mesh,
56 const dictionary& dict
57)
58:
59 mesh_(mesh),
60 engineDB_(refCast<const engineTime>(mesh_.time())),
61 patchID_(dict.lookup("patch"), mesh.boundaryMesh()),
62 csysPtr_
63 (
65 ),
66 minLayer_(dict.get<scalar>("minLayer")),
67 maxLayer_(dict.get<scalar>("maxLayer"))
68{}
69
70
71// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
72
74{
75 os << nl;
76 os.beginBlock();
77 os.writeEntry("patch", patchID_.name());
78 os.writeEntry("minLayer", minLayer_);
79 os.writeEntry("maxLayer", maxLayer_);
80 os.endBlock();
81}
82
83
84// ************************************************************************* //
const wordRe & name() const noexcept
The selector name.
Definition DynamicID.H:123
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
Base class for coordinate system specification, the default coordinate system type is cartesian .
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
void writeDict(Ostream &) const
Write dictionary.
scalar maxLayer() const
scalar minLayer() const
An abstract class for the time description of the piston motion.
Definition engineTime.H:53
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
Lookup type of boundary radiation properties.
Definition lookup.H:60
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
Interpolates y values from one curve to another with a different x distribution.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
Definition typeInfo.H:172
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50
dictionary dict