![]() |
SFEMaNS
version 5.3
Reference documentation for SFEMaNS
|
In this example, we check the correctness of SFEMaNS for a hydrodynamic problem with a moving solid obstacle involving Dirichlet boundary conditions. The set up consists of a fluid driven by contra rotating impellers in a cylindrical container. In the litterature, it is referred as Von Karman Sodium. Here we study the case with impellers called TM73, we refer to the paper Direct numerical simulation of the axial dipolar dynamo in the Von Karman Sodium experiment (Nore et al. 2016) for more information on this set up.
This test does not involve manufactured solutions and consists of checking four quantities, like the \(\bL^2\) norm of the velocity, are the same as the reference values.
We solve the Navier-Stokes equations:
\begin{align*} \partial_t\bu+\left(\ROT\bu\right)\CROSS\bu - \frac{1}{\Re}\LAP \bu +\GRAD p &=\bef &\text{ in } \Omega_\text{fluid}, \\ \bu & = r \omega \be_\theta &\text{ in } \Omega_\text{imp_bot}, \\ \bu & = -r \omega \be_\theta &\text{ in } \Omega_\text{imp_top}, \\ \DIV \bu &= 0, &\\ \bu_{|\Gamma} &= \bu_{\text{bdy}} ,& \\ \bu_{|t=0} &= \bu_0, &\\ p_{|t=0} &= p_0,& \end{align*}
in the domain \(\Omega= \{ (r,\theta,z) \in {R}^3 : (r,\theta,z) \in [0,1] \times [0,2\pi) \times [-1,1]\}\). This domain is the union of a fluid domain \(\Omega_\text{fluid}\) and two solid domains, \(\Omega_\text{imp_top}\) and \(\Omega_\text{imp_bot}\) that represent the impellers. These subdomains depend of time as the impellers are contra-rotating with the angular velocity \(\omega\). We also define \(\Gamma= \partial \Omega \). The data are the source term \(\bef\), the angular velocity \(\omega\), the penalty function \(\chi\), the boundary data \(\bu_{\text{bdy}}\), the initial datas \(\bu_0\) and \(p_0\). The parameter \(\Re\) is the kinetic Reynolds number.
Remark: The velocity field is forced to match the velocity of the impellers in the solid subdomains with a penalty method. This method involves a penalty function \(\chi\) equal to 1 in \(\Omega_\text{fluid}\) and zero elsewhere.
As mentionned earlier this test does not involve manufactured solutions. As a consequence, we do not consider specific source term and only initialize the dependent variables.
The initial velocity field and pressure are initialized as follows:
\begin{align*} u_r(r,\theta,z,t) &= 0, \\ u_{\theta}(r,\theta,z,t) &= \begin{cases} -r \omega \be_\theta & \text{ in } \Omega_\text{imp_top}, \\ 0 &\text{ in } \Omega_\text{fluid}, \\ r \omega \be_\theta & \text{ in } \Omega_\text{imp_bot}, \end{cases} \\ u_z(r,\theta,z,t) &= 0, \\ p(r,\theta,z,t) &= 0, \end{align*}
The penalty function \(\chi\) is defined such that it is equal to 1 in the fluid domain \(\Omega_1\) and \(0\) elsewhere. We note that we use a smooth penalty function.
The finite element mesh used for this test is named mesh_T28_0_04_04_ext3.FEM and has a mesh size of \(0.04\) for the P1 approximation. You can generate this mesh with the files in the following directory: ($SFEMaNS_MESH_GEN_DIR)/EXAMPLES/EXAMPLES_MANUFACTURED_SOLUTIONS/mesh_T28_0_04_04_ext3. The following image shows the mesh for P1 finite elements.
Finite element mesh (P1). |
The following images show a 3D representation of the VKS set up and the shape of the impellers that drive the fluid.
VKS Setting. |
Impeller TM73. |
condlim.f90The initial conditions, boundary conditions, the forcing term and the penalty function are set in the file condlim_test_28.f90. Here is a description of the subroutines and functions of interest.
init_velocity_pressure initializes the velocity field and the pressure at the time \(-dt\) and \(0\) with \(dt\) being the time step. This is done by using the functions vv_exact and pp_exact as follows: vv_exact contains the analytical velocity field. It is used to initialize the velocity field and to impose Dirichlet boundary conditions on the velocity field. pp_exact contains the analytical pressure. It is used to initialize the pressure to zero. source_in_NS_momentum computes the source term \(\bef\) of the Navier-Stokes equations. It is set to zero. penal_in_real_space defines the penalty function \(\chi\) in the real space (depending of the node in the meridian plan and its angle n). This is done by calling the function smooth_penal_in_real_space as follows: smooth_bottom_propeller or smooth_top_propeller. imposed_velocity_by_penalty is used to set a non zero velocity in the impellers. All the other subroutines present in the file condlim_test_28.f90 are not used in this test. We refer to the section Fortran file condlim.f90 for a description of all the subroutines of the condlim file.
We describe the data file of this test. It is called debug_data_test_28 and can be found in the directory ($SFEMaNS_DIR)/MHD_DATA_TEST_CONV_PETSC.
lis when you run the shell debug_SFEMaNS_template. The outputs of this test are computed with the file post_processing_debug.f90 that can be found in the following directory: ($SFEMaNS_DIR)/MHD_DATA_TEST_CONV_PETSC.
To check the correctness of the code, we compute four quantities:
These quantities are computed at the final time \(t=0.1\). They are compared to reference values to attest of the correctness of the code.
These values of reference are in the last lines of the file debug_data_test_28 in the directory ($SFEMaNS_DIR)/MHD_DATA_TEST_CONV_PETSC. They are equal to:
To conclude this test, we show the profile of the approximated pressure and velocity magnitude at the final time. These figures are done in the plane \(y=0\) which is the union of the half plane \(\theta=0\) and \(\theta=\pi\).
Pressure in the plane plane y=0. |
Velocity magnitude in the plane plane y=0. |