forceSuSpI.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) 2011 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
29 // * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * //
30 
32 :
33  Tuple2<vector, scalar>(vector::zero, 0)
34 {}
35 
36 
38 (
39  const Tuple2<vector, scalar>& fs
40 )
41 :
43 {}
44 
45 
46 inline Foam::forceSuSp::forceSuSp(const vector& Su, const scalar Sp)
47 {
48  first() = Su;
49  second() = Sp;
50 }
51 
52 
54 :
55  Tuple2<vector, scalar>(is)
56 {}
57 
58 
59 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
60 
61 inline const Foam::vector& Foam::forceSuSp::Su() const
62 {
63  return first();
64 }
65 
66 
67 inline Foam::scalar Foam::forceSuSp::Sp() const
68 {
69  return second();
70 }
71 
72 
74 {
75  return first();
76 }
77 
78 
79 inline Foam::scalar& Foam::forceSuSp::Sp()
80 {
81  return second();
82 }
83 
84 
85 // * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * * //
86 
87 inline void Foam::forceSuSp::operator+=(const forceSuSp& susp)
88 {
89  first() += susp.first();
90  second() += susp.second();
91 }
92 
93 
94 inline void Foam::forceSuSp::operator-=(const forceSuSp& susp)
95 {
96  first() -= susp.first();
97  second() -= susp.second();
98 }
99 
100 
101 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
102 
103 inline Foam::forceSuSp Foam::operator+
104 (
105  const forceSuSp& susp1,
106  const forceSuSp& susp2
107 )
108 {
109  return forceSuSp
110  (
111  susp1.first() + susp2.first(),
112  susp1.second() + susp2.second()
113  );
114 }
115 
116 
117 inline Foam::forceSuSp Foam::operator*
118 (
119  const scalar s,
120  const forceSuSp& susp
121 )
122 {
123  return forceSuSp(susp.first()*s, susp.second()*s);
124 }
125 
126 
127 // ************************************************************************* //
Foam::forceSuSp::forceSuSp
forceSuSp()=default
Default construct.
s
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputSpray.H:25
Sp
zeroField Sp
Definition: alphaSuSp.H:2
Foam::forceSuSp::Su
const vector & Su() const
Return const access to the explicit contribution [kg.m/s2].
Definition: forceSuSpI.H:61
Su
zeroField Su
Definition: alphaSuSp.H:1
Foam::forceSuSp::operator+=
void operator+=(const forceSuSp &susp)
Addition.
Definition: forceSuSpI.H:87
Foam::forceSuSp::operator-=
void operator-=(const forceSuSp &susp)
Subtraction.
Definition: forceSuSpI.H:94
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::forceSuSp
Helper container for force Su and Sp terms.
Definition: forceSuSp.H:64
Foam::Vector< scalar >
Foam::Tuple2::second
const T2 & second() const noexcept
Return second.
Definition: Tuple2.H:130
Foam::forceSuSp::Sp
scalar Sp() const
Return const access to the implicit coefficient [kg/s].
Definition: forceSuSpI.H:67
Foam::Tuple2
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition: stringOps.H:60
Foam::Tuple2::first
const T1 & first() const noexcept
Return first.
Definition: Tuple2.H:118
Foam::zero
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:62