Loading...
Searching...
No Matches
eddyI.H
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 OpenFOAM Foundation
9 Copyright (C) 2016-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
30
31using namespace Foam::constant;
32
33// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34
35Foam::scalar Foam::eddy::epsi(Random& rndGen) const
36{
37 // Random number with zero mean and unit variance
38 return rndGen.sample01<scalar>() > 0.5 ? 1 : -1;
39}
40
42inline Foam::label Foam::eddy::patchFaceI() const noexcept
43{
44 return patchFaceI_;
45}
46
48inline const Foam::point& Foam::eddy::position0() const noexcept
49{
50 return position0_;
51}
52
54inline Foam::scalar Foam::eddy::x() const noexcept
55{
56 return x_;
57}
58
60inline const Foam::vector& Foam::eddy::sigma() const noexcept
61{
62 return sigma_;
63}
64
66inline const Foam::vector& Foam::eddy::alpha() const noexcept
67{
68 return alpha_;
69}
70
72inline const Foam::tensor& Foam::eddy::Rpg() const noexcept
73{
74 return Rpg_;
75}
76
78inline Foam::scalar Foam::eddy::c1() const noexcept
79{
80 return c1_;
81}
82
84inline Foam::point Foam::eddy::position(const vector& n) const
85{
86 return position0_ + n*x_;
87}
88
91{
92 return vector(epsi(rndGen), epsi(rndGen), epsi(rndGen));
93}
94
96inline Foam::scalar Foam::eddy::volume() const
97{
98 return mathematical::pi*4.0/3.0*cmptProduct(sigma_);
99}
100
102void Foam::eddy::move(const scalar dx)
103{
104 x_ += dx;
105}
106
107
108Foam::boundBox Foam::eddy::bounds(const bool global) const
109{
110 boundBox bb;
111
112 if (global)
113 {
114 bb.min() = Rpg_ & -sigma_;
115 bb.max() = Rpg_ & sigma_;
116 }
117 else
118 {
119 bb.min() = -sigma_;
120 bb.max() = sigma_;
121 }
122
123 return bb;
124}
125
126
127// ************************************************************************* //
label n
Random number generator.
Definition Random.H:56
A bounding box defined in terms of min/max extrema points.
Definition boundBox.H:71
const point & max() const noexcept
Maximum describing the bounding box.
Definition boundBoxI.H:168
const point & min() const noexcept
Minimum describing the bounding box.
Definition boundBoxI.H:162
void move(const scalar dx)
Move the eddy.
Definition eddyI.H:95
scalar c1() const noexcept
Return the model coefficient c1.
Definition eddyI.H:71
const tensor & Rpg() const noexcept
Return the coordinate system transformation from local principal to global axes.
Definition eddyI.H:65
const point & position0() const noexcept
Return the reference position.
Definition eddyI.H:41
scalar volume() const
Volume.
Definition eddyI.H:89
boundBox bounds(const bool global=true) const
Eddy bounds.
Definition eddyI.H:101
const vector & alpha() const noexcept
Return the time-averaged intensity.
Definition eddyI.H:59
point position(const vector &n) const
Return the eddy position.
Definition eddyI.H:77
vector epsilon(Random &rndGen) const
Return random vector of -1 and 1's.
Definition eddyI.H:83
label patchFaceI() const noexcept
Return the patch face index that spawned the eddy.
Definition eddyI.H:35
scalar x() const noexcept
Return the distance from the reference position.
Definition eddyI.H:47
const vector & sigma() const noexcept
Return the length scales in 3-D space.
Definition eddyI.H:53
constexpr scalar pi(M_PI)
Different types of constants.
Cmpt cmptProduct(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
Tensor< scalar > tensor
Definition symmTensor.H:57
vector point
Point is a vector.
Definition point.H:37
const direction noexcept
Definition scalarImpl.H:265
Vector< scalar > vector
Definition vector.H:57
Random rndGen