From fac6bdc025b92747d716bddbfe6bf282ee4e79bc Mon Sep 17 00:00:00 2001 From: Oriol Colomes Date: Tue, 4 Jan 2022 16:45:01 +0100 Subject: [PATCH] Update to Gridap@0.17 --- Project.toml | 2 +- src/fsi_tutorial.jl | 36 +++++++++++++++--------------------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/Project.toml b/Project.toml index 05061af4..8ee08901 100644 --- a/Project.toml +++ b/Project.toml @@ -20,7 +20,7 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" [compat] -Gridap = "0.16.4" +Gridap = "0.17" GridapGmsh = "0.4" SpecialFunctions = "1" julia = "1.3" diff --git a/src/fsi_tutorial.jl b/src/fsi_tutorial.jl index 51232fc2..8c7a8eb7 100644 --- a/src/fsi_tutorial.jl +++ b/src/fsi_tutorial.jl @@ -176,9 +176,18 @@ const μ_f = 0.01 # Q \doteq \{ q \in C^0(\Omega):\ q|_T\in P_{k-1}(T) \text{ for all } T\in\mathcal{T}_{\rm F}\}. # ``` -# 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. -model_solid = DiscreteModel(model,tags="solid") -model_fluid = DiscreteModel(model,tags="fluid") +# 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}$. +Ω = Interior(model) +Ω_s = Interior(model,tags="solid") +Ω_f = Interior(model,tags="fluid") + +# 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. +Γ_out = BoundaryTriangulation(model,tags="outlet") +n_Γout = get_normal_vector(Γ_out) + +# 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. +Γ_fs = InterfaceTriangulation(Ω_f,Ω_s) +n_Γfs = get_normal_vector(Γ_fs) # In what follows we will assume a second-order veloticty interpolation, i.e. $k=2$ k = 2 @@ -189,20 +198,20 @@ reffeₚ = ReferenceFE(lagrangian,Float64,k-1) # 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}$ . Vf = TestFESpace( - model_fluid, + Ω_f, reffeᵤ, conformity=:H1, dirichlet_tags=["inlet", "noSlip", "cylinder"]) Vs = TestFESpace( - model_solid, + Ω_s, reffeᵤ, conformity=:H1, dirichlet_tags=["fixed"]) # For the pressure test FE space, we use the fluid discrete model, the pressure reference FE `reffeₚ` and `:C0` conformity. Qf = TestFESpace( - model_fluid, + Ω_f, reffeₚ, conformity=:C0) @@ -219,21 +228,6 @@ X = MultiFieldFESpace([Us,Uf,Pf]) # # ``` # ### Numerical integration -# 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}$. -Ω = Triangulation(model) - -# 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. -Ω_s = Triangulation(model_solid) -Ω_f = Triangulation(model_fluid) - -# 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. -Γ_out = BoundaryTriangulation(model,tags="outlet") -n_Γout = get_normal_vector(Γ_out) - -# 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. -Γ_fs = InterfaceTriangulation(model_fluid,model_solid) -n_Γfs = get_normal_vector(Γ_fs) - # 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$. degree = 2*k dΩₛ = Measure(Ω_s,degree)