OpenFOAM: API Guide
v2112
The open source CFD toolbox
eulerianParticle.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) 2015-2016 OpenCFD Ltd.
9
-------------------------------------------------------------------------------
10
License
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 "
eulerianParticle.H
"
29
#include "
mathematicalConstants.H
"
30
31
using namespace
Foam::constant
;
32
33
// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
34
35
Foam::functionObjects::eulerianParticle::eulerianParticle
()
36
:
37
faceIHit(-1),
38
VC(
Zero
),
39
VU(
Zero
),
40
V(0),
41
time(0)
42
{}
43
44
45
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
46
47
Foam::Ostream
& Foam::operator<<
48
(
49
Ostream
&
os
,
50
const
functionObjects::eulerianParticle
&
p
51
)
52
{
53
os
<<
p
.faceIHit <<
token::SPACE
54
<<
p
.VC <<
token::SPACE
55
<<
p
.VU <<
token::SPACE
56
<<
p
.V <<
token::SPACE
57
<<
p
.time;
58
59
return
os
;
60
}
61
62
63
Foam::Istream
& Foam::operator>>
64
(
65
Istream
& is,
66
functionObjects::eulerianParticle
&
p
67
)
68
{
69
is >>
p
.faceIHit
70
>>
p
.VC
71
>>
p
.VU
72
>>
p
.V
73
>>
p
.time;
74
75
return
is;
76
}
77
78
79
void
Foam::functionObjects::eulerianParticle::write
(
Ostream
&
os
)
const
80
{
81
scalar pDiameter =
cbrt
(6*V/
constant::mathematical::pi
);
82
vector
U
= VU/(V + ROOTVSMALL);
83
vector
C
= VC/(V + ROOTVSMALL);
84
85
os
<< time <<
token::SPACE
86
<< faceIHit <<
token::SPACE
87
<<
C
<<
token::SPACE
88
<< pDiameter <<
token::SPACE
89
<<
U
<<
token::SPACE
90
<<
endl
;
91
}
92
93
94
Foam::dictionary
Foam::functionObjects::eulerianParticle::writeDict
()
const
95
{
96
scalar pDiameter =
cbrt
(6*V/
constant::mathematical::pi
);
97
vector
U
= VU/(V + ROOTVSMALL);
98
vector
C
= VC/(V + ROOTVSMALL);
99
100
dictionary
dict
;
101
dict
.add(
"time"
, time);
102
dict
.add(
"meshFace"
, faceIHit);
103
dict
.add(
"position"
,
C
);
104
dict
.add(
"diameter"
, pDiameter);
105
dict
.add(
"U"
,
U
);
106
107
return
dict
;
108
}
109
110
111
// ************************************************************************* //
mathematicalConstants.H
p
volScalarField & p
Definition:
createFieldRefs.H:8
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition:
zero.H:131
Foam::constant
Different types of constants.
Definition:
atomicConstants.C:38
Foam::functionObjects::eulerianParticle
Definition:
eulerianParticle.H:71
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:369
eulerianParticle.H
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition:
Istream.H:61
Foam::functionObjects::eulerianParticle::writeDict
Foam::dictionary writeDict() const
Write to dictionary.
Definition:
eulerianParticle.C:94
dict
dictionary dict
Definition:
searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition:
dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
U
U
Definition:
pEqn.H:72
Foam::constant::mathematical::pi
constexpr scalar pi(M_PI)
Foam::Vector< scalar >
Foam::token::SPACE
Space [isspace].
Definition:
token.H:125
Foam::functionObjects::eulerianParticle::write
void write(Ostream &os) const
Write to stream.
Definition:
eulerianParticle.C:79
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition:
Ostream.H:56
Foam::C
Graphite solid properties.
Definition:
C.H:50
Foam::cbrt
dimensionedScalar cbrt(const dimensionedScalar &ds)
Definition:
dimensionedScalar.C:155
Foam::functionObjects::eulerianParticle::eulerianParticle
eulerianParticle()
Constructor.
Definition:
eulerianParticle.C:35
src
functionObjects
field
extractEulerianParticles
eulerianParticle
eulerianParticle.C
Generated by
1.8.17
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.