fsi_driven_cavity_mesh.h
Go to the documentation of this file.
1// LIC// ====================================================================
2// LIC// This file forms part of oomph-lib, the object-oriented,
3// LIC// multi-physics finite-element library, available
4// LIC// at http://www.oomph-lib.org.
5// LIC//
6// LIC// Copyright (C) 2006-2025 Matthias Heil and Andrew Hazel
7// LIC//
8// LIC// This library is free software; you can redistribute it and/or
9// LIC// modify it under the terms of the GNU Lesser General Public
10// LIC// License as published by the Free Software Foundation; either
11// LIC// version 2.1 of the License, or (at your option) any later version.
12// LIC//
13// LIC// This library is distributed in the hope that it will be useful,
14// LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16// LIC// Lesser General Public License for more details.
17// LIC//
18// LIC// You should have received a copy of the GNU Lesser General Public
19// LIC// License along with this library; if not, write to the Free Software
20// LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21// LIC// 02110-1301 USA.
22// LIC//
23// LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24// LIC//
25// LIC//====================================================================
26
27// Include guards
28#ifndef OOMPH_FSI_DRIVEN_CAVITY_MESH_HEADER
29#define OOMPH_FSI_DRIVEN_CAVITY_MESH_HEADER
30
31// Generic includes
32#include "generic/refineable_quad_mesh.h"
33#include "generic/macro_element.h"
34#include "generic/domain.h"
35#include "generic/quad_mesh.h"
36
37// Mesh is based on simple_rectangular_quadmesh
39
40// Include algebraic elements
41#include "generic/algebraic_elements.h"
42
43namespace oomph
44{
45 //========================================================================
46 /// Mesh for W. Wall's FSI driven cavity problem.
47 /// The mesh is derived from the \c SimpleRectangularQuadMesh
48 /// so it's node and element numbering scheme is the same
49 /// as in that mesh. Only the boundaries are numbered differently
50 /// to allow the easy identification of the "collapsible" segment.
51 /// Boundary coordinates are set up for all nodes
52 /// located on boundary 3 (the collapsible segment).
53 /// The curvilinear ("collapsible") segment is defined by
54 /// a \c GeomObject.
55 /// - Boundary 0 is the moving lid.
56 /// - Boundary 1 is the gap above the moving lid on the right wall
57 /// - Boundary 2 is the rigid part of the right wall
58 /// - Boundary 3 is the moving (elastic) wall
59 /// - Boundary 4 is the rigid part of the left wall
60 /// - Boundary 5 is the gap above the moving lid on the left wall
61 //========================================================================
62 template<class ELEMENT>
64 {
65 public:
66 /// Constructor: Pass number of elements, number of elements,
67 /// fractional height of the gap above the moving wall,
68 /// pointer to GeomObject that defines the collapsible segment and pointer
69 /// to TimeStepper (defaults to the default timestepper, Steady).
71 const unsigned& nx,
72 const unsigned& ny,
73 const double& lx,
74 const double& ly,
75 const double& gap_fraction,
76 GeomObject* wall_pt,
77 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper);
78
79 protected:
80 /// Number of elements in x direction
81 unsigned Nx;
82
83 /// Number of elements in y direction
84 unsigned Ny;
85
86 /// Fraction of the gap next to moving lid, relative to the
87 /// height of the domain
89
90 /// Pointer to geometric object that represents the moving wall
92 };
93
94
95 /////////////////////////////////////////////////////////////////////
96 /////////////////////////////////////////////////////////////////////
97 /////////////////////////////////////////////////////////////////////
98
99 //===================================================================
100 /// Refineable version of FSIDrivenCavityMesh.
101 /// The mesh is derived from the \c SimpleRectangularQuadMesh
102 /// so it's node and element numbering scheme is the same
103 /// as in that mesh. Only the boundaries are numbered differently
104 /// to allow the easy identification of the "collapsible" segment.
105 /// Boundary coordinates are set up for all nodes
106 /// located on boundary 3 (the collapsible segment).
107 /// The curvilinear ("collapsible") segment is defined by
108 /// a \c GeomObject.
109 /// - Boundary 0 is the moving lid.
110 /// - Boundary 1 is the gap above the moving lid on the right wall
111 /// - Boundary 2 is the rigid part of the right wall
112 /// - Boundary 3 is the moving (elastic) wall
113 /// - Boundary 4 is the rigid part of the left wall
114 /// - Boundary 5 is the gap above the moving lid on the left wall
115 //====================================================================
116 template<class ELEMENT>
118 : public virtual FSIDrivenCavityMesh<ELEMENT>,
119 public RefineableQuadMesh<ELEMENT>
120 {
121 public:
122 /// Constructor: Pass number of elements, lengths, pointer to
123 /// geometric object that describes the wall and timestepper
125 const unsigned& nx,
126 const unsigned& ny,
127 const double& lx,
128 const double& ly,
129 const double& gap_fraction,
130 GeomObject* wall_pt,
131 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
133 nx, ny, lx, ly, gap_fraction, wall_pt, time_stepper_pt)
134 {
135 // Build quadtree forest
136 this->setup_quadtree_forest();
137 }
138
139 /// Destructor(empty)
141 };
142
143 //=================================================================
144 /// / Alebraic node update version of FSIDrivenCavityMesh
145 /// - Boundary 0 is the moving lid.
146 /// - Boundary 1 is the gap above the moving lid on the right wall
147 /// - Boundary 2 is the rigid part of the right wall
148 /// - Boundary 3 is the moving (elastic) wall
149 /// - Boundary 4 is the rigid part of the left wall
150 /// - Boundary 5 is the gap above the moving lid on the left wall
151 //=================================================================
152 template<class ELEMENT>
154 : public virtual FSIDrivenCavityMesh<ELEMENT>,
155 public AlgebraicMesh
156 {
157 public:
158 /// Constructor: Pass number of elements, lengths, pointer to
159 /// GeomObject that defines the collapsible segment and pointer to
160 /// TimeStepper (defaults to the default timestepper, Steady).
162 const unsigned& nx,
163 const unsigned& ny,
164 const double& lx,
165 const double& ly,
166 const double& gap_fraction,
167 GeomObject* wall_pt,
168 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
170 nx, ny, lx, ly, gap_fraction, wall_pt, time_stepper_pt)
171 {
172 // Add the geometric object to the list associated with this AlgebraicMesh
173 AlgebraicMesh::add_geom_object_list_pt(wall_pt);
174
175 // Setup algebraic node update operations
177 }
178
179 /// Destructor: empty
181
182 /// Update nodal position at time level t (t=0: present;
183 /// t>0: previous)
184 void algebraic_node_update(const unsigned& t, AlgebraicNode*& node_pt);
185
186 /// Update the node-udate data after mesh adaptation.
187 /// Empty -- no update of node update required as this is
188 /// non-refineable mesh.
190
191 protected:
192 /// Function to setup the algebraic node update
194 };
195
196
197 ///////////////////////////////////////////////////////////////////////////
198 ///////////////////////////////////////////////////////////////////////////
199 ///////////////////////////////////////////////////////////////////////////
200
201 //=================================================================
202 /// Refineable version algebraic FSIDrivenCavityMesh.
203 /// - Boundary 0 is the moving lid.
204 /// - Boundary 1 is the gap above the moving lid on the right wall
205 /// - Boundary 2 is the rigid part of the right wall
206 /// - Boundary 3 is the moving (elastic) wall
207 /// - Boundary 4 is the rigid part of the left wall
208 /// - Boundary 5 is the gap above the moving lid on the left wall
209 //=================================================================
210 template<class ELEMENT>
212 : public RefineableQuadMesh<ELEMENT>,
213 public virtual AlgebraicFSIDrivenCavityMesh<ELEMENT>
214 {
215 public:
216 /// Constructor: Pass number of elements, lengths, pointer to
217 /// GeomObject that defines the collapsible segment and pointer to
218 /// TimeStepper (defaults to the default timestepper, Steady).
220 const unsigned& nx,
221 const unsigned& ny,
222 const double& lx,
223 const double& ly,
224 const double& gap_fraction,
225 GeomObject* wall_pt,
226 TimeStepper* time_stepper_pt = &Mesh::Default_TimeStepper)
228 nx, ny, lx, ly, gap_fraction, wall_pt, time_stepper_pt),
230 nx, ny, lx, ly, gap_fraction, wall_pt, time_stepper_pt)
231 {
232 // Build quadtree forest
233 this->setup_quadtree_forest();
234 }
235
236 /// Update the node update data for specified node following
237 /// any mesh adapation
239 };
240
241} // namespace oomph
242
244#endif
/ Alebraic node update version of FSIDrivenCavityMesh
virtual ~AlgebraicFSIDrivenCavityMesh()
Destructor: empty.
void algebraic_node_update(const unsigned &t, AlgebraicNode *&node_pt)
Update nodal position at time level t (t=0: present; t>0: previous)
void setup_algebraic_node_update()
Function to setup the algebraic node update.
void update_node_update(AlgebraicNode *&node_pt)
Update the node-udate data after mesh adaptation. Empty – no update of node update required as this i...
AlgebraicFSIDrivenCavityMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, const double &gap_fraction, GeomObject *wall_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements, lengths, pointer to GeomObject that defines the collapsible seg...
Mesh for W. Wall's FSI driven cavity problem. The mesh is derived from the SimpleRectangularQuadMesh ...
unsigned Nx
Number of elements in x direction.
GeomObject * Wall_pt
Pointer to geometric object that represents the moving wall.
double Gap_fraction
Fraction of the gap next to moving lid, relative to the height of the domain.
unsigned Ny
Number of elements in y direction.
Refineable version algebraic FSIDrivenCavityMesh.
RefineableAlgebraicFSIDrivenCavityMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, const double &gap_fraction, GeomObject *wall_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements, lengths, pointer to GeomObject that defines the collapsible seg...
void update_node_update(AlgebraicNode *&node_pt)
Update the node update data for specified node following any mesh adapation.
Refineable version of FSIDrivenCavityMesh. The mesh is derived from the SimpleRectangularQuadMesh so ...
RefineableFSIDrivenCavityMesh(const unsigned &nx, const unsigned &ny, const double &lx, const double &ly, const double &gap_fraction, GeomObject *wall_pt, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements, lengths, pointer to geometric object that describes the wall an...
Unstructured refineable Triangle Mesh.
Simple rectangular 2D Quad mesh class. Nx : number of elements in the x direction.
const unsigned & ny() const
Access function for number of elements in y directions.
const unsigned & nx() const
Access function for number of elements in x directions.