You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/fsi_tutorial.jl
+15-21Lines changed: 15 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -176,9 +176,18 @@ const μ_f = 0.01
176
176
# Q \doteq \{ q \in C^0(\Omega):\ q|_T\in P_{k-1}(T) \text{ for all } T\in\mathcal{T}_{\rm F}\}.
177
177
# ```
178
178
179
-
# Before creating the FE spaces, we first need to define the discrete model of each of the sub-domains, which are constructed restricting the global discrete model to the corresponding part. This is done by calling the `DiscreteModel` function with the desired geometrical part label, i.e. `"solid"` and `"fluid"`, respectively.
180
-
model_solid =DiscreteModel(model,tags="solid")
181
-
model_fluid =DiscreteModel(model,tags="fluid")
179
+
# Before creating the FE spaces, we first need to define the triangulation of each of the sub-domains, which are constructed restricting the global triangulation to the corresponding part. This is done by calling the `Triangulation` (or equivalently `Interior`) function with the desired geometrical part label, i.e. `"solid"` and `"fluid"`, respectively. Here we create the triangulation of the global domain, $\mathcal{T}$, and the solid and fluid triangulations, $\mathcal{T}_{\rm F}$ and $\mathcal{T}_{\rm S}$.
180
+
Ω =Interior(model)
181
+
Ω_s =Interior(model,tags="solid")
182
+
Ω_f =Interior(model,tags="fluid")
183
+
184
+
# We also generate the triangulation and associated outer normal field for the outlet boundary, $\Gamma_{\rm F,N_{out}}$, which will be used to impose a Neumann condition.
185
+
Γ_out =BoundaryTriangulation(model,tags="outlet")
186
+
n_Γout =get_normal_vector(Γ_out)
187
+
188
+
# Finally, to impose the interface condition between solid and fluid, we will need the triangulation and normal field of such interface, $\Gamma_{\rm FS}$. The interface triangulation is generated by calling the `InterfaceTriangulation` function specifying the two interfacing domain triangulations. Note that the normal field will point outwards with respect to the first entry.
189
+
Γ_fs =InterfaceTriangulation(Ω_f,Ω_s)
190
+
n_Γfs =get_normal_vector(Γ_fs)
182
191
183
192
# In what follows we will assume a second-order veloticty interpolation, i.e. $k=2$
# Having set up all the ingredients, we can create the different FE spaces for the test functions. For the velocity FE spaces we call the `TestFESpace` function with the corresponding discrete model, using the velocity reference FE `reffeᵤ` and conformity `:H1`. Note that we assign different Dirichlet boundary labels for the two different parts, generating the variational spaces with homogeneous Dirichlet boundary conditions, $V_{\rm F,0}$ and $V_{\rm S,0}$ .
191
200
Vf =TestFESpace(
192
-
model_fluid,
201
+
Ω_f,
193
202
reffeᵤ,
194
203
conformity=:H1,
195
204
dirichlet_tags=["inlet", "noSlip", "cylinder"])
196
205
197
206
Vs =TestFESpace(
198
-
model_solid,
207
+
Ω_s,
199
208
reffeᵤ,
200
209
conformity=:H1,
201
210
dirichlet_tags=["fixed"])
202
211
203
212
# For the pressure test FE space, we use the fluid discrete model, the pressure reference FE `reffeₚ` and `:C0` conformity.
204
213
Qf =TestFESpace(
205
-
model_fluid,
214
+
Ω_f,
206
215
reffeₚ,
207
216
conformity=:C0)
208
217
@@ -219,21 +228,6 @@ X = MultiFieldFESpace([Us,Uf,Pf])
219
228
# <a name="integration"></a>
220
229
# ```
221
230
# ### Numerical integration
222
-
# To define the quadrature rules used in the numerical integration of the different terms, we first need to generate the domain triangulation. Here we create the triangulation of the global domain, $\mathcal{T}$.
223
-
Ω =Triangulation(model)
224
-
225
-
# The solid and fluid triangulations, $\mathcal{T}_{\rm F}$ and $\mathcal{T}_{\rm S}$, are constructed from the discrete models restricted to the respective parts.
226
-
Ω_s =Triangulation(model_solid)
227
-
Ω_f =Triangulation(model_fluid)
228
-
229
-
# We also generate the triangulation and associated outer normal field for the outlet boundary, $\Gamma_{\rm F,N_{out}}$, which will be used to impose a Neumann condition.
230
-
Γ_out =BoundaryTriangulation(model,tags="outlet")
231
-
n_Γout =get_normal_vector(Γ_out)
232
-
233
-
# Finally, to impose the interface condition between solid and fluid, we will need the triangulation and normal field of such interface, $\Gamma_{\rm FS}$. The interface triangulation is generated by calling the `InterfaceTriangulation` function specifying the two interfacing domain models. Note that the normal field will point outwards with respect to the first entry.
# Once we have all the triangulations, we can generate the quadrature rules to be applied each domain. This will be generated by calling the `Measure` function, that given a triangulation and an integration degree, it returns the Lebesgue integral measure $d\Omega$.
0 commit comments