Loading...
Searching...
No Matches
forceList.C
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) 2020 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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\*---------------------------------------------------------------------------*/
27
28#include "forceList.H"
29
30// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31
32namespace Foam
33{
34namespace regionModels
35{
37{
38
39// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42:
43 PtrList<force>()
44{}
45
46
48(
49 liquidFilmBase& film,
50 const dictionary& dict
51)
52:
53 PtrList<force>()
54{
55 const wordList models(dict.lookup("forces"));
56
57 Info<< " Selecting film force models" << endl;
58 if (models.size() > 0)
59 {
60 this->setSize(models.size());
61
62 forAll(models, i)
63 {
64 set(i, force::New(film, dict, models[i]));
65 }
66 }
67 else
68 {
69 Info<< " none" << endl;
70 }
71}
72
73
74// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
77{}
78
79
80// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
81
83{
85 auto& result = tResult.ref();
86
87 forAll(*this, i)
88 {
89 result += this->operator[](i).correct(U);
90 }
91
92 return tResult;
93}
94
95// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96
97} // End namespace areaSurfaceFilmModels
98} // End namespace regionModels
99} // End namespace Foam
100
101// ************************************************************************* //
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
const force * set(const label i) const
Definition PtrList.H:171
void setSize(const label n)
Definition PtrList.H:357
constexpr PtrList() noexcept
Definition PtrListI.H:29
void size(const label n)
Older name for setAddressableSize.
Definition UList.H:118
const force & operator[](const label i) const
Definition UPtrListI.H:289
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
forceList(liquidFilmBase &film)
Construct null.
Definition forceList.C:34
tmp< faVectorMatrix > correct(areaVectorField &U)
Return (net) force system.
Definition forceList.C:75
Base class for film (stress-based) force models.
Definition force.H:55
static autoPtr< force > New(liquidFilmBase &film, const dictionary &dict, const word &modelType)
Return a reference to the selected force model.
Definition forceNew.C:35
A class for managing temporary objects.
Definition tmp.H:75
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Definition tmp.H:215
U
Definition pEqn.H:72
Namespace for OpenFOAM.
List< word > wordList
List of word.
Definition fileName.H:60
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
GeometricField< vector, faPatchField, areaMesh > areaVectorField
const dimensionSet dimForce
const dimensionSet dimDensity
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299