Loading...
Searching...
No Matches
regionFaIBMList.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) 2022-2025 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
26Class
27 Foam::regionModels::areaSurfaceFilmModels::regionFaIBMList
28
29Description
30 Immersed Boundary Method (IBM) for finite area (FA)
31
32SourceFiles
33 regionFaIBMList.cxx
34 regionFaIBMList.txx
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_FA_regionFaIBMList_H
39#define Foam_FA_regionFaIBMList_H
40
41#include "regionFaIBM.H"
42#include "IOdictionary.H"
43#include "PtrList.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49namespace regionModels
50{
52{
54/*---------------------------------------------------------------------------*\
55 Class regionFaIBMList Declaration
56\*---------------------------------------------------------------------------*/
57
59:
60 public IOdictionary,
61 public PtrList<regionFaIBM>
62{
63 // Private Member Function
64
65 //- Const reference to the list of regionFaIBM
66 const UPtrList<regionFaIBM>& ibm_list() const noexcept
67 {
68 return static_cast<const UPtrList<regionFaIBM>&>(*this);
69 }
70
71 //- Non-const reference to the list of regionFaIBM
72 PtrList<regionFaIBM>& ibm_list() noexcept
73 {
74 return static_cast<PtrList<regionFaIBM>&>(*this);
75 }
76
77
78protected:
79
80 // Protected Data
81
82 //- Interpolated velocity
85
86public:
87
88 //- Constructor
89 regionFaIBMList(const Time& runTime, const faMesh& aMesh);
90
91 //- Destructor
92 virtual ~regionFaIBMList() = default;
93
94
95 // Member Functions
96
97 //- Ustar velocity
98 const areaVectorField& Ustar() const noexcept { return Ustar_; }
99
100 //- Ustar velocity
101 areaVectorField& Ustar() noexcept { return Ustar_; }
102
103
104 //- Update mesh
106
107 //- Correct the regionFaIBM model
108 bool correct(const areaVectorField& Us);
109
110 //- Apply the zero filter to an area field
111 template<class Type>
112 void zeroFilter(Type& fld) const;
113};
114
115
116// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117
118} // End namespace areaSurfaceFilmModels
119} // End namespace regionModels
120} // End namespace Foam
122// ************************************************************************* //
123
124#ifdef NoRepository
125 #include "regionFaIBMList.txx"
126#endif
128// ************************************************************************* //
129
130#endif
131
132// ************************************************************************* //
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
IOdictionary(const IOobject &io, const dictionary *fallback=nullptr)
Construct given an IOobject and optional fallback dictionary content.
constexpr PtrList() noexcept
Definition PtrListI.H:29
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
UPtrList(Detail::PtrListDetail< regionFaIBM > &&ptrs) noexcept
Definition UPtrListI.H:48
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition faMesh.H:140
areaVectorField & Ustar() noexcept
Ustar velocity.
const areaVectorField & Ustar() const noexcept
Ustar velocity.
regionFaIBMList(const Time &runTime, const faMesh &aMesh)
Constructor.
void zeroFilter(Type &fld) const
Apply the zero filter to an area field.
bool correct(const areaVectorField &Us)
Correct the regionFaIBM model.
thermo correct()
engineTime & runTime
Namespace for OpenFOAM.
GeometricField< vector, faPatchField, areaMesh > areaVectorField
const direction noexcept
Definition scalarImpl.H:265