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-------------------------------------------------------------------------------
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 "eulerianParticle.H"
30
31using namespace Foam::constant;
32
33// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
34
36:
37 faceIHit(-1),
38 VC(Zero),
39 VU(Zero),
40 V(0),
41 time(0)
42{}
43
44
45// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
46
47Foam::Ostream& Foam::operator<<
48(
49 Ostream& os,
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
63Foam::Istream& Foam::operator>>
64(
65 Istream& is,
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
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
95{
96 scalar pDiameter = cbrt(6*V/constant::mathematical::pi);
97 vector U = VU/(V + ROOTVSMALL);
98 vector C = VC/(V + ROOTVSMALL);
99
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// ************************************************************************* //
Graphite solid properties.
Definition: C.H:53
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
virtual bool write()
Write the output fields.
Foam::dictionary writeDict() const
Write to dictionary.
@ SPACE
Space [isspace].
Definition: token.H:125
U
Definition: pEqn.H:72
volScalarField & p
OBJstream os(runTime.globalPath()/outputName)
constexpr scalar pi(M_PI)
Different types of constants.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
dimensionedScalar cbrt(const dimensionedScalar &ds)
dictionary dict