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 | 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 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 class forceSuSp;
52 inline forceSuSp operator+(const forceSuSp& susp1, const forceSuSp& susp2);
53 inline forceSuSp operator*(const forceSuSp& susp, const scalar s);
54 
55 /*---------------------------------------------------------------------------*\
56  Class forceSuSp Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class forceSuSp
60 :
61  public Tuple2<vector, scalar>
62 {
63 
64 public:
65 
66  // Constructors
67 
68  //- Construct null
69  inline forceSuSp();
70 
71  //- Construct given Tuple2
72  inline forceSuSp(const Tuple2<vector, scalar>& susp);
73 
74  //- Construct given two components
75  inline forceSuSp(const vector& Su, const scalar Sp);
76 
77  //- Construct from Istream
78  inline forceSuSp(Istream&);
79 
80 
81  // Member Functions
82 
83  // Access
84 
85  //- Return const access to the explicit contribution [kg.m/s2]
86  inline const vector& Su() const;
87 
88  //- Return const access to the implicit coefficient [kg/s]
89  inline scalar Sp() const;
90 
91 
92  // Edit
93 
94  //- Return reference to the explicit contribution
95  inline vector& Su();
96 
97  //- Return reference to the implicit coefficient
98  inline scalar& Sp();
99 
100 
101  // Operators
102 
103  //- Assignment
104  inline void operator=(const forceSuSp& susp);
105 
106  //- Addition
107  inline void operator+=(const forceSuSp& susp);
108 
109  //- Subtraction
110  inline void operator-=(const forceSuSp& susp);
111 
112 
113  // Friend operators
114 
115  //- Addition
116  friend inline forceSuSp operator*
117  (
118  const forceSuSp& susp1,
119  const forceSuSp& susp2
120  );
121 
122  //- Multiplication
123  friend inline forceSuSp operator*
124  (
125  const scalar s,
126  const forceSuSp& susp
127  );
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #include "forceSuSpI.H"
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
Foam::forceSuSp::Sp
scalar Sp() const
Return const access to the implicit coefficient [kg/s].
Definition: forceSuSpI.H:62
Tuple2.H
Foam::forceSuSp::operator+=
void operator+=(const forceSuSp &susp)
Addition.
Definition: forceSuSpI.H:89
Foam::forceSuSp::operator-=
void operator-=(const forceSuSp &susp)
Subtraction.
Definition: forceSuSpI.H:96
forceSuSpI.H
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::forceSuSp
Helper container for force Su and Sp terms.
Definition: forceSuSp.H:58
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
s
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))
Foam::forceSuSp::operator=
void operator=(const forceSuSp &susp)
Assignment.
Definition: forceSuSpI.H:82
Foam::operator*
tmp< fvMatrix< Type > > operator*(const DimensionedField< scalar, volMesh > &, const fvMatrix< Type > &)
Foam::Vector< scalar >
Foam::Tuple2
A 2-tuple for storing two objects of different types.
Definition: Tuple2.H:47
Foam::forceSuSp::Su
const vector & Su() const
Return const access to the explicit contribution [kg.m/s2].
Definition: forceSuSpI.H:56
Foam::operator+
tmp< fvMatrix< Type > > operator+(const fvMatrix< Type > &, const fvMatrix< Type > &)
Foam::forceSuSp::forceSuSp
forceSuSp()
Construct null.
Definition: forceSuSpI.H:28