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 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::forceSuSp
29
30Description
31 Helper container for force Su and Sp terms.
32
33 F = Sp(U - Up) + Su
34
35 Explicit contribution, Su specified as a force
36 Implicit coefficient, Sp specified as force/velocity
37
38SourceFiles
39 forceSuSpI.H
40
41\*---------------------------------------------------------------------------*/
42
43#ifndef forceSuSp_H
44#define forceSuSp_H
45
46#include "Tuple2.H"
47#include "vector.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
53
54// Forward Declarations
55class forceSuSp;
56
57inline forceSuSp operator+(const forceSuSp& susp1, const forceSuSp& susp2);
58inline forceSuSp operator*(const scalar s, const forceSuSp& susp);
59
60
61/*---------------------------------------------------------------------------*\
62 Class forceSuSp Declaration
63\*---------------------------------------------------------------------------*/
65class forceSuSp
66:
67 public Tuple2<vector, scalar>
68{
69public:
70
71 // Constructors
72
73 //- Default construct
74 forceSuSp() = default;
75
76 //- Construct zero-initialized content
77 inline forceSuSp(const Foam::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 explicit 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 //- Addition
112 inline void operator+=(const forceSuSp& susp);
113
114 //- Subtraction
115 inline void operator-=(const forceSuSp& susp);
116
117
118 // Friend Operators
119
120 //- Addition
121 friend inline forceSuSp operator*
122 (
123 const forceSuSp& susp1,
124 const forceSuSp& susp2
125 );
126
127 //- Multiplication
128 friend inline forceSuSp operator*
129 (
130 const scalar s,
131 const forceSuSp& susp
132 );
133};
134
135
136// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137
138} // End namespace Foam
139
140// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141
142#include "forceSuSpI.H"
143
144// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145
146#endif
147
148// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition: Tuple2.H:58
Helper container for force Su and Sp terms.
Definition: forceSuSp.H:67
forceSuSp()=default
Default construct.
const vector & Su() const
Return const access to the explicit contribution [kg.m/s2].
Definition: forceSuSpI.H:61
void operator-=(const forceSuSp &susp)
Subtraction.
Definition: forceSuSpI.H:94
void operator+=(const forceSuSp &susp)
Addition.
Definition: forceSuSpI.H:87
scalar Sp() const
Return const access to the implicit coefficient [kg/s].
Definition: forceSuSpI.H:67
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:63
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))
Namespace for OpenFOAM.
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
tmp< faMatrix< Type > > operator*(const areaScalarField::Internal &, const faMatrix< Type > &)