forceSuSp.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-2016 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 Class
27  Foam::forceSuSp
28 
29 Description
30  Helper container for force Su and Sp terms.
31 
32  F = Sp(U - Up) + Su
33 
34  Explicit contribution, Su specified as a force
35  Implicit coefficient, Sp specified as force/velocity
36 
37 SourceFiles
38  forceSuSpI.H
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef forceSuSp_H
43 #define forceSuSp_H
44 
45 #include "Tuple2.H"
46 #include "vector.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 // Forward declarations
54 class forceSuSp;
55 
56 inline forceSuSp operator+(const forceSuSp& susp1, const forceSuSp& susp2);
57 inline forceSuSp operator*(const scalar s, const forceSuSp& susp);
58 
59 
60 /*---------------------------------------------------------------------------*\
61  Class forceSuSp Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class forceSuSp
65 :
66  public Tuple2<vector, scalar>
67 {
68 
69 public:
70 
71  // Constructors
72 
73  //- Construct null
74  inline forceSuSp();
75 
76  //- Construct zero-initialized content
77  inline forceSuSp(const zero);
78 
79  //- Construct given Tuple2
80  inline forceSuSp(const Tuple2<vector, scalar>& susp);
81 
82  //- Construct given two components
83  inline forceSuSp(const vector& Su, const scalar Sp);
84 
85  //- Construct from Istream
86  inline forceSuSp(Istream& is);
87 
88 
89  // Member Functions
90 
91  // Access
92 
93  //- Return const access to the explicit contribution [kg.m/s2]
94  inline const vector& Su() const;
95 
96  //- Return const access to the implicit coefficient [kg/s]
97  inline scalar Sp() const;
98 
99 
100  // Edit
101 
102  //- Return reference to the explicit contribution
103  inline vector& Su();
104 
105  //- Return reference to the implicit coefficient
106  inline scalar& Sp();
107 
108 
109  // Operators
110 
111  //- Assignment
112  inline void operator=(const forceSuSp& susp);
113 
114  //- Addition
115  inline void operator+=(const forceSuSp& susp);
116 
117  //- Subtraction
118  inline void operator-=(const forceSuSp& susp);
119 
120 
121  // Friend operators
122 
123  //- Addition
124  friend inline forceSuSp operator*
125  (
126  const forceSuSp& susp1,
127  const forceSuSp& susp2
128  );
129 
130  //- Multiplication
131  friend inline forceSuSp operator*
132  (
133  const scalar s,
134  const forceSuSp& susp
135  );
136 };
137 
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #include "forceSuSpI.H"
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************************************************************* //
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
Tuple2.H
Foam::forceSuSp::Su
const vector & Su() const
Return const access to the explicit contribution [kg.m/s2].
Definition: forceSuSpI.H:64
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
forceSuSpI.H
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
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::forceSuSp::operator=
void operator=(const forceSuSp &susp)
Assignment.
Definition: forceSuSpI.H:90
Foam::Vector< scalar >
Foam::operator+
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
Foam::operator*
tmp< faMatrix< Type > > operator*(const areaScalarField &, const faMatrix< Type > &)
vector.H
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::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