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