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 -------------------------------------------------------------------------------
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 // * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * //
29 
31 {}
32 
33 
35 :
36  Tuple2<vector, scalar>(vector::zero, 0.0)
37 {}
38 
39 
41 (
42  const Tuple2<vector, scalar>& fs
43 )
44 :
46 {}
47 
48 
49 inline Foam::forceSuSp::forceSuSp(const vector& Su, const scalar Sp)
50 {
51  first() = Su;
52  second() = Sp;
53 }
54 
55 
57 :
58  Tuple2<vector, scalar>(is)
59 {}
60 
61 
62 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
63 
64 inline const Foam::vector& Foam::forceSuSp::Su() const
65 {
66  return first();
67 }
68 
69 
70 inline Foam::scalar Foam::forceSuSp::Sp() const
71 {
72  return second();
73 }
74 
75 
77 {
78  return first();
79 }
80 
81 
82 inline Foam::scalar& Foam::forceSuSp::Sp()
83 {
84  return second();
85 }
86 
87 
88 // * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * * //
89 
90 inline void Foam::forceSuSp::operator=(const forceSuSp& susp)
91 {
92  first() = susp.first();
93  second() = susp.second();
94 }
95 
96 
97 inline void Foam::forceSuSp::operator+=(const forceSuSp& susp)
98 {
99  first() += susp.first();
100  second() += susp.second();
101 }
102 
103 
104 inline void Foam::forceSuSp::operator-=(const forceSuSp& susp)
105 {
106  first() -= susp.first();
107  second() -= susp.second();
108 }
109 
110 
111 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
112 
113 inline Foam::forceSuSp Foam::operator+
114 (
115  const forceSuSp& susp1,
116  const forceSuSp& susp2
117 )
118 {
119  return forceSuSp
120  (
121  susp1.first() + susp2.first(),
122  susp1.second() + susp2.second()
123  );
124 }
125 
126 
127 inline Foam::forceSuSp Foam::operator*
128 (
129  const scalar s,
130  const forceSuSp& susp
131 )
132 {
133  return forceSuSp(susp.first()*s, susp.second()*s);
134 }
135 
136 
137 // ************************************************************************* //
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:64
Su
zeroField Su
Definition: alphaSuSp.H:1
Foam::forceSuSp::operator+=
void operator+=(const forceSuSp &susp)
Addition.
Definition: forceSuSpI.H:97
Foam::forceSuSp::operator-=
void operator-=(const forceSuSp &susp)
Subtraction.
Definition: forceSuSpI.H:104
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:63
Foam::forceSuSp::operator=
void operator=(const forceSuSp &susp)
Assignment.
Definition: forceSuSpI.H:90
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:70
Foam::Tuple2
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition: Tuple2.H:57
Foam::Tuple2::first
const T1 & first() const noexcept
Return first.
Definition: Tuple2.H:118
Foam::forceSuSp::forceSuSp
forceSuSp()
Construct null.
Definition: forceSuSpI.H:30
Foam::zero
A class representing the concept of 0 (zero), which can be used to avoid manipulating objects that ar...
Definition: zero.H:61