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) 2011-2017 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 \*---------------------------------------------------------------------------*/
27 
28 #include "forceList.H"
29 
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace regionModels
35 {
36 namespace surfaceFilmModels
37 {
38 
39 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40 
42 :
43  PtrList<force>()
44 {}
45 
46 
48 (
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 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
74 
76 {}
77 
78 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
79 
81 {
82  tmp<fvVectorMatrix> tResult
83  (
85  );
86  fvVectorMatrix& result = tResult.ref();
87 
88  forAll(*this, i)
89  {
90  result += this->operator[](i).correct(U);
91  }
92 
93  return tResult;
94 }
95 
96 
97 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
98 
99 } // End namespace surfaceFilmModels
100 } // End namespace regionModels
101 } // End namespace Foam
102 
103 // ************************************************************************* //
setSize
points setSize(newPointi)
Foam::BitOps::set
void set(List< bool > &bools, const labelRange &range)
Definition: BitOps.C:30
forceList.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:57
Foam::regionModels::surfaceFilmModels::forceList::forceList
forceList(surfaceFilmRegionModel &film)
Definition: forceList.C:34
Foam::endl
Ostream & endl(Ostream &os)
Definition: Ostream.H:381
Foam::PtrList< force >::set
const T * set(const label i) const
Definition: PtrList.H:134
Foam::regionModels::surfaceFilmModels::forceList::correct
tmp< fvVectorMatrix > correct(volVectorField &U)
Definition: forceList.C:73
Foam::dimForce
const dimensionSet dimForce
forAll
#define forAll(list, i)
Definition: stdFoam.H:349
Foam::tmp::ref
T & ref() const
Definition: tmpI.H:220
Foam::fvVectorMatrix
fvMatrix< vector > fvVectorMatrix
Definition: fvMatricesFwd.H:41
Foam::dimArea
const dimensionSet dimArea(sqr(dimLength))
Definition: dimensionSets.H:57
Foam::regionModels::surfaceFilmModels::surfaceFilmRegionModel
Base class for surface film models.
Definition: surfaceFilmRegionModel.H:51
Foam::Info
messageStream Info
Foam::regionModels::surfaceFilmModels::force::New
static autoPtr< force > New(surfaceFilmRegionModel &film, const dictionary &dict, const word &modelType)
Definition: forceNew.C:36
Foam::PtrList< force >::setSize
void setSize(const label newLen)
Definition: PtrList.H:147
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:55
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:119
Foam
Definition: atmBoundaryLayer.C:26
U
U
Definition: pEqn.H:72
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:58
Foam::regionModels::surfaceFilmModels::force
Base class for film (stress-based) force models.
Definition: force.H:53
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:64
Foam::regionModels::surfaceFilmModels::forceList::~forceList
virtual ~forceList()
Definition: forceList.C:68
Foam::dimVolume
const dimensionSet dimVolume(pow3(dimLength))
Definition: dimensionSets.H:58
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:49