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 | Copyright (C) 2011 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 // * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * //
27 
29 {}
30 
31 
33 (
34  const Tuple2<vector, scalar>& fs
35 )
36 :
38 {}
39 
40 
41 inline Foam::forceSuSp::forceSuSp(const vector& Su, const scalar Sp)
42 {
43  first() = Su;
44  second() = Sp;
45 }
46 
47 
49 :
50  Tuple2<vector, scalar>(is)
51 {}
52 
53 
54 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
55 
56 inline const Foam::vector& Foam::forceSuSp::Su() const
57 {
58  return first();
59 }
60 
61 
62 inline Foam::scalar Foam::forceSuSp::Sp() const
63 {
64  return second();
65 }
66 
67 
69 {
70  return first();
71 }
72 
73 
74 inline Foam::scalar& Foam::forceSuSp::Sp()
75 {
76  return second();
77 }
78 
79 
80 // * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * * //
81 
82 inline void Foam::forceSuSp::operator=(const forceSuSp& susp)
83 {
84  first() = susp.first();
85  second() = susp.second();
86 }
87 
88 
89 inline void Foam::forceSuSp::operator+=(const forceSuSp& susp)
90 {
91  first() += susp.first();
92  second() += susp.second();
93 }
94 
95 
96 inline void Foam::forceSuSp::operator-=(const forceSuSp& susp)
97 {
98  first() -= susp.first();
99  second() -= susp.second();
100 }
101 
102 
103 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
104 
105 inline Foam::forceSuSp Foam::operator+
106 (
107  const forceSuSp& susp1,
108  const forceSuSp& susp2
109 )
110 {
111  return forceSuSp
112  (
113  susp1.first() + susp2.first(),
114  susp1.second() + susp2.second()
115  );
116 }
117 
118 
119 inline Foam::forceSuSp Foam::operator*
120 (
121  const scalar s,
122  const forceSuSp& susp
123 )
124 {
125  return forceSuSp(susp.first()*s, susp.second()*s);
126 }
127 
128 
129 // ************************************************************************* //
const scalar & second() const
Return second.
Definition: Tuple2.H:106
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().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 ))
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
scalar Sp() const
Return const access to the implicit coefficient [kg/s].
Definition: forceSuSpI.H:62
const vector & first() const
Return first.
Definition: Tuple2.H:94
const vector & Su() const
Return const access to the explicit contribution [kg.m/s2].
Definition: forceSuSpI.H:56
void operator-=(const forceSuSp &susp)
Subtraction.
Definition: forceSuSpI.H:96
forceSuSp()
Construct null.
Definition: forceSuSpI.H:28
void operator+=(const forceSuSp &susp)
Addition.
Definition: forceSuSpI.H:89
void operator=(const forceSuSp &susp)
Assignment.
Definition: forceSuSpI.H:82
Helper container for force Su and Sp terms.
Definition: forceSuSp.H:58