All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
forceSuSpI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
97 
98 inline Foam::forceSuSp Foam::operator+
99 (
100  const forceSuSp& susp1,
101  const forceSuSp& susp2
102 )
103 {
104  return forceSuSp
105  (
106  susp1.first() + susp2.first(),
107  susp1.second() + susp2.second()
108  );
109 }
110 
111 
112 inline Foam::forceSuSp Foam::operator*
113 (
114  const scalar s,
115  const forceSuSp& susp
116 )
117 {
118  return forceSuSp(susp.first()*s, susp.second()*s);
119 }
120 
121 
122 // ************************************************************************* //
const vector & Su() const
Return const access to the explicit contribution [kg m/s^2].
Definition: forceSuSpI.H:56
const vector & first() const
Return first.
Definition: Tuple2.H:99
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
forceSuSp()
Construct null.
Definition: forceSuSpI.H:28
void operator+=(const forceSuSp &susp)
Addition.
Definition: forceSuSpI.H:82
Helper container for force Su and Sp terms.
Definition: forceSuSp.H:61
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))
scalar Sp() const
Return const access to the implicit coefficient [kg/s].
Definition: forceSuSpI.H:62
void operator-=(const forceSuSp &susp)
Subtraction.
Definition: forceSuSpI.H:89
const scalar & second() const
Return second.
Definition: Tuple2.H:111