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
28#include "enginePiston.H"
29#include "engineTime.H"
30#include "polyMesh.H"
31#include "interpolateXY.H"
32
33// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34
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
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 (
64 coordinateSystem::New(mesh_, dict, coordinateSystem::typeName_())
65 ),
66 minLayer_(dict.get<scalar>("minLayer")),
67 maxLayer_(dict.get<scalar>("maxLayer"))
68{}
69
70
71// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
72
74{
76 << "patch " << patchID_.name() << token::END_STATEMENT << nl
77 << "minLayer " << minLayer_ << token::END_STATEMENT << nl
78 << "maxLayer " << maxLayer_ << token::END_STATEMENT << nl
80}
81
82
83// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
Definition: boundaryMesh.H:63
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:126
Foam::enginePiston.
Definition: enginePiston.H:56
An abstract class for the time description of the piston motion.
Definition: engineTime.H:57
Foam::dictionary writeDict() const
Write to dictionary.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Lookup type of boundary radiation properties.
Definition: lookup.H:66
@ BEGIN_BLOCK
Begin block [isseparator].
Definition: token.H:159
@ END_BLOCK
End block [isseparator].
Definition: token.H:160
@ END_STATEMENT
End entry [isseparator].
Definition: token.H:154
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
Interpolates y values from one curve to another with a different x distribution.
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:131
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
dictionary dict