OpenFOAM
6
The OpenFOAM Foundation
Main Page
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
v
w
+
Enumerations
a
b
c
d
e
f
g
i
k
l
m
o
p
r
s
t
v
w
+
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Related Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
+
Files
File List
+
File Members
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Typedefs
b
c
d
f
g
k
l
m
p
r
s
t
v
w
+
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
engine
engineTime
freePiston
freePiston.H
Go to the documentation of this file.
1
/*---------------------------------------------------------------------------*\
2
========= |
3
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
\\ / O peration | Website: https://openfoam.org
5
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
6
\\/ M anipulation |
7
-------------------------------------------------------------------------------
8
License
9
This file is part of OpenFOAM.
10
11
OpenFOAM is free software: you can redistribute it and/or modify it
12
under the terms of the GNU General Public License as published by
13
the Free Software Foundation, either version 3 of the License, or
14
(at your option) any later version.
15
16
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19
for more details.
20
21
You should have received a copy of the GNU General Public License
22
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23
24
Class
25
Foam::freePiston
26
27
Description
28
In case of free pistons, the piston position is determined by a user-defined
29
position according to time.
30
31
The piston trajectory is specified in \c constant/engineGeometry using a
32
table or a separated file. The position is relative to the cylinder head,
33
i.e. decreasing when compressing.
34
35
For example,
36
\verbatim
37
pistonPositionTime table ( (0 0.13) (0.020 0.03) );
38
\endverbatim
39
40
or with a tableFile
41
\verbatim
42
pistonPositionTime tableFile;
43
pistonPositionTimeCoeffs
44
{
45
file "data";
46
outOfBounds clamp;
47
interpolationScheme linear;
48
}
49
\endverbatim
50
51
SourceFiles
52
freePiston.C
53
54
\*---------------------------------------------------------------------------*/
55
56
#ifndef freePiston_H
57
#define freePiston_H
58
59
#include "
engineTime.H
"
60
#include "
dictionary.H
"
61
#include "
dimensionedScalar.H
"
62
#include "
Function1.H
"
63
64
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65
66
namespace
Foam
67
{
68
69
/*---------------------------------------------------------------------------*\
70
Class freePiston Declaration
71
\*---------------------------------------------------------------------------*/
72
73
class
freePiston
74
:
75
public
engineTime
76
{
77
// Private data
78
79
autoPtr<Function1<scalar>
> pistonPositionTime_;
80
81
82
// Private Member Functions
83
84
//- Disallow default bitwise copy construct
85
freePiston
(
const
freePiston
&);
86
87
//- Disallow default bitwise assignment
88
void
operator=(
const
freePiston
&);
89
90
91
public
:
92
93
//- Runtime type information
94
TypeName
(
"freePiston"
);
95
96
97
// Constructors
98
99
//- Construct from objectRegistry arguments
100
freePiston
101
(
102
const
word
&
name
,
103
const
fileName
&
rootPath
,
104
const
fileName
&
caseName
,
105
const
fileName
& systemName =
"system"
,
106
const
fileName
& constantName =
"constant"
,
107
const
fileName
&
dictName
=
"engineGeometry"
108
);
109
110
//- Destructor
111
virtual
~freePiston
()
112
{}
113
114
115
// Member Functions
116
117
// Conversion
118
119
//- Calculate the piston position from the engine geometry
120
// and given crank angle.
121
scalar
pistonPosition
(
const
scalar
theta
)
const
;
122
123
124
// Access
125
126
//- Return current engine time
127
virtual
scalar
theta
()
const
;
128
129
//- Return time unit
130
virtual
word
unit
()
const
;
131
132
//- Return engine time increment
133
virtual
scalar
deltaTheta
()
const
;
134
};
135
136
137
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138
139
}
// End namespace Foam
140
141
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142
143
#endif
144
145
// ************************************************************************* //
Foam::fileName
A class for handling file names.
Definition:
fileName.H:69
engineTime.H
Foam::engineTime::pistonPosition
dimensionedScalar pistonPosition() const
Return current piston position.
Definition:
engineTime.C:93
Foam::engineTime
An abstract class for the time description of the piston motion.
Definition:
engineTime.H:51
Foam::freePiston::unit
virtual word unit() const
Return time unit.
Definition:
freePiston.C:73
Foam::freePiston
In case of free pistons, the piston position is determined by a user-defined position according to ti...
Definition:
freePiston.H:72
Foam::word
A class for handling words, derived from string.
Definition:
word.H:59
Foam::Time::caseName
const fileName & caseName() const
Return case name.
Definition:
Time.H:260
Function1.H
dictName
const word dictName("particleTrackDict")
Foam::freePiston::~freePiston
virtual ~freePiston()
Destructor.
Definition:
freePiston.H:110
Foam::dimensioned< scalar >::name
const word & name() const
Return const reference to name.
Definition:
dimensionedType.C:235
dimensionedScalar.H
Foam::freePiston::theta
virtual scalar theta() const
Return current engine time.
Definition:
freePiston.C:67
Foam::freePiston::deltaTheta
virtual scalar deltaTheta() const
Return engine time increment.
Definition:
freePiston.C:79
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition:
PtrList.H:52
Foam::freePiston::TypeName
TypeName("freePiston")
Runtime type information.
dictionary.H
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.C:30
Foam::Time::rootPath
const fileName & rootPath() const
Return root path.
Definition:
Time.H:254
Generated by
1.8.13