SFEMaNS  version 5.3
Reference documentation for SFEMaNS
sub_ns_with_momentum.f90
Go to the documentation of this file.
1 !
2 !Authors Jean-Luc Guermond, Raphael Laguerre, Caroline Nore, Copyrights 2005
3 !Revised for PETSC, Jean-Luc Guermond, Franky Luddens, January 2011
4 !
6  USE my_util
7 #include "petsc/finclude/petsc.h"
8  USE petsc
11  PRIVATE
12 CONTAINS
13 
14  SUBROUTINE three_level_ns_tensor_sym_with_m(comm_one_d, time, vv_3_LA, pp_1_LA, &
15  dt, re, list_mode, pp_mesh, vv_mesh, incpn_m1, incpn, pn_m1, pn, un_m1, un, &
16  hn_p2, bn_p2, density_m1, density, density_p1, visco_dyn, tempn, level_set, level_set_p1, &
17  visc_entro_level)
18 
19  !==============================
20  USE def_type_mesh
21  USE fem_m_axi
22  USE fem_rhs_axi
23  USE fem_tn_axi
24  USE dir_nodes_petsc
25  USE periodic
26  USE st_matrix
27  USE solve_petsc
28  USE dyn_line
29  USE boundary
31  USE sub_plot
32  USE st_matrix
33  USE input_data
34  USE sft_parallele
35  USE tn_axi
36  USE verbose
38  USE subroutine_mass
39  IMPLICIT NONE
40  REAL(KIND=8) :: time, dt, Re
41  INTEGER, DIMENSION(:), INTENT(IN) :: list_mode
42  TYPE(mesh_type), INTENT(IN) :: pp_mesh, vv_mesh
43  TYPE(petsc_csr_la) :: vv_3_LA, pp_1_LA
44  REAL(KIND=8), DIMENSION(:,:,:), INTENT(INOUT) :: incpn_m1, incpn
45  REAL(KIND=8), DIMENSION(:,:,:), INTENT(INOUT) :: pn_m1, pn
46  REAL(KIND=8), DIMENSION(:,:,:), INTENT(INOUT) :: un_m1, un
47  REAL(KIND=8), DIMENSION(:,:,:), INTENT(IN) :: density_m1, density, density_p1
48  REAL(KIND=8), DIMENSION(:,:,:,:), INTENT(IN) :: level_set, level_set_p1
49  REAL(KIND=8), DIMENSION(:,:,:), INTENT(IN) :: visco_dyn
50  REAL(KIND=8), DIMENSION(:,:,:), INTENT(IN) :: tempn
51  REAL(KIND=8), DIMENSION(:,:,:), INTENT(IN) :: Hn_p2, Bn_p2
52  REAL(KIND=8), DIMENSION(vv_mesh%np,6,SIZE(list_mode)) :: Hn_p2_aux
53  REAL(KIND=8), DIMENSION(:,:), INTENT(OUT) :: visc_entro_level
54  INTEGER, SAVE :: m_max_c
55  TYPE(dyn_real_line),DIMENSION(:), ALLOCATABLE, SAVE :: pp_global_D
56  TYPE(dyn_int_line), DIMENSION(:), POINTER, SAVE :: pp_mode_global_js_D
57  TYPE(dyn_int_line), DIMENSION(3), SAVE :: vv_js_D
58  TYPE(dyn_int_line), DIMENSION(:), POINTER, SAVE :: vv_mode_global_js_D
59  TYPE(dyn_real_line),DIMENSION(:), ALLOCATABLE, SAVE :: vel_global_D
60  LOGICAL, SAVE :: once = .true.
61  INTEGER, SAVE :: my_petscworld_rank
62  REAL(KIND=8), SAVE :: mu_bar, nu_bar, rho_bar, sqrt_2d_vol
63  REAL(KIND=8), DIMENSION(:,:,:), ALLOCATABLE, SAVE :: momentum, momentum_m1, momentum_m2
64  INTEGER, SAVE :: bloc_size, m_max_pad, nb_procs
65  REAL(KIND=8), ALLOCATABLE, DIMENSION(:,:,:), SAVE :: rotb_b_m1
66  REAL(KIND=8), ALLOCATABLE, DIMENSION(:,:,:,:), SAVE :: visc_grad_vel_m1
67  REAL(KIND=8), ALLOCATABLE, DIMENSION(:,:,:,:), SAVE :: tensor_m1
68  REAL(KIND=8), ALLOCATABLE, DIMENSION(:,:), SAVE :: visc_entro_real
69  !----------FIN SAVE--------------------------------------------------------------------
70 
71  !----------Declaration sans save-------------------------------------------------------
72  INTEGER, POINTER, DIMENSION(:) :: pp_1_ifrom, vv_3_ifrom
73  INTEGER :: i, k, m, n
74  INTEGER :: code,nu_mat, mode
75  REAL(KIND=8) :: moyenne
76  !allocations des variables locales
77  REAL(KIND=8), DIMENSION(pp_mesh%np, 2, SIZE(list_mode)) :: div
78  REAL(KIND=8), DIMENSION(pp_mesh%np, 2) :: pn_p1, phi
79  REAL(KIND=8), DIMENSION(vv_mesh%np, 2) :: p_p2
80  REAL(KIND=8), DIMENSION(vv_mesh%np, 6) :: un_p1, src
81  REAL(KIND=8), DIMENSION(vv_mesh%gauss%l_G*vv_mesh%dom_me,6,SIZE(list_mode)) :: rotb_b, rotb_b_aux
82  REAL(KIND=8), DIMENSION(3,vv_mesh%gauss%l_G*vv_mesh%dom_me,6,SIZE(list_mode)) :: visc_grad_vel
83  REAL(KIND=8), DIMENSION(3,vv_mesh%gauss%l_G*vv_mesh%dom_me,6,SIZE(list_mode)) :: visc_entro_grad_mom
84  REAL(KIND=8), DIMENSION(3,vv_mesh%gauss%l_G*vv_mesh%dom_me,6,SIZE(list_mode)) :: tensor_surface_gauss
85  REAL(KIND=8), DIMENSION(3,vv_mesh%np,6,SIZE(list_mode)) :: tensor
86  REAL(KIND=8), DIMENSION(3,vv_mesh%gauss%l_G*vv_mesh%dom_me,6) :: visc_grad_vel_ext
87  REAL(KIND=8), DIMENSION(3,vv_mesh%np,6) :: tensor_ext
88  REAL(KIND=8), DIMENSION(vv_mesh%np,6,SIZE(list_mode)) :: uext, momentumext, momentum_exact
89  REAL(KIND=8), DIMENSION(inputs%nb_fluid-1, vv_mesh%np, 2, SIZE(list_mode)) :: level_set_FEM_P2
90  REAL(KIND=8), DIMENSION(vv_mesh%np) :: vel_loc, vel_tot
91  REAL(KIND=8), DIMENSION(SIZE(list_mode)) :: normalization_mt
92  REAL(KINd=8) :: vel_tot_max_S,vel_tot_max
93  INTEGER :: n1, n2, n3, n123, nb_inter
94  REAL(KIND=8) :: tps, tps_tot, tps_cumul, coeff, cfl, cfl_max, norm
95  INTEGER :: nb_procs_LES, bloc_size_LES, m_max_pad_LES
96  !April 17th 2008, JLG
97  REAL(KIND=8) :: one, zero, three
98  DATA zero, one, three/0.d0,1.d0,3.d0/
99 
100  !Communicators for Petsc, in space and Fourier------------------------------
101  petscerrorcode :: ierr
102  mpi_comm, DIMENSION(:), POINTER :: comm_one_d
103  mat, DIMENSION(:), POINTER, SAVE :: vel_mat
104  mat, DIMENSION(:), POINTER, SAVE :: press_mat
105  mat, SAVE :: mass_mat, mass_mat0
106  vec, SAVE :: vb_3_145, vb_3_236, vx_3, vx_3_ghost
107  vec, SAVE :: pb_1, pb_2, px_1, px_1_ghost
108  ksp, DIMENSION(:), POINTER, SAVE :: vel_ksp, press_ksp
109  ksp, SAVE :: mass_ksp, mass_ksp0
110  !------------------------------END OF DECLARATION--------------------------------------
111 
112 
113  IF (once) THEN
114 
115  once = .false.
116 
117  CALL mpi_comm_rank(petsc_comm_world,my_petscworld_rank,code)
118 
119  !-----CREATE PETSC VECTORS AND GHOSTS-----------------------------------------
120  CALL create_my_ghost(vv_mesh,vv_3_la,vv_3_ifrom)
121  n = 3*vv_mesh%dom_np
122  CALL veccreateghost(comm_one_d(1), n, &
123  petsc_determine, SIZE(vv_3_ifrom), vv_3_ifrom, vx_3, ierr)
124  CALL vecghostgetlocalform(vx_3, vx_3_ghost, ierr)
125  CALL vecduplicate(vx_3, vb_3_145, ierr)
126  CALL vecduplicate(vx_3, vb_3_236, ierr)
127 
128  CALL create_my_ghost(pp_mesh,pp_1_la,pp_1_ifrom)
129  n = pp_mesh%dom_np
130  CALL veccreateghost(comm_one_d(1), n, &
131  petsc_determine, SIZE(pp_1_ifrom), pp_1_ifrom, px_1, ierr)
132  CALL vecghostgetlocalform(px_1, px_1_ghost, ierr)
133  CALL vecduplicate(px_1, pb_1, ierr)
134  CALL vecduplicate(px_1, pb_2, ierr)
135  !------------------------------------------------------------------------------
136 
137  !-------------DIMENSIONS-------------------------------------------------------
138  m_max_c = SIZE(list_mode)
139  !------------------------------------------------------------------------------
140 
141  !-------------MOMENTUM INITIALIZATION------------------------------------------
142  ALLOCATE(momentum(SIZE(un,1),SIZE(un,2), SIZE(un,3)),&
143  momentum_m1(SIZE(un,1),SIZE(un,2), SIZE(un,3)), &
144  momentum_m2(SIZE(un,1),SIZE(un,2), SIZE(un,3)))
145  CALL mpi_comm_size(comm_one_d(2), nb_procs, code)
146  bloc_size = SIZE(un,1)/nb_procs+1
147  m_max_pad = 3*SIZE(list_mode)*nb_procs/2
148 
149  IF (inputs%if_level_set) THEN
150  CALL fft_scalar_vect_dcl(comm_one_d(2), un_m1, density_m1, momentum_m1, 1, nb_procs, &
151  bloc_size, m_max_pad)
152  CALL fft_scalar_vect_dcl(comm_one_d(2), un, density, momentum, 1, nb_procs, &
153  bloc_size, m_max_pad)
154  ELSE
155  momentum_m1 = un_m1
156  momentum = un
157  END IF
158 
159  ALLOCATE(rotb_b_m1(vv_mesh%gauss%l_G*vv_mesh%dom_me,6,SIZE(list_mode)))
160  rotb_b_m1 = 0.d0
161 
162  ALLOCATE(tensor_m1(3,vv_mesh%np,6,SIZE(list_mode)))
163  bloc_size = SIZE(un,1)/nb_procs+1
164  m_max_pad = 3*SIZE(list_mode)*nb_procs/2
165  CALL fft_tensor_dcl(comm_one_d(2), momentum_m1, un_m1, tensor_m1, nb_procs, bloc_size, m_max_pad)
166 
167  ALLOCATE(visc_grad_vel_m1(3,vv_mesh%gauss%l_G*vv_mesh%dom_me,6,SIZE(list_mode)))
168  CALL smb_explicit_diffu_sym(comm_one_d(2), vv_mesh, list_mode, nb_procs, &
169  visco_dyn/re, un_m1, visc_grad_vel_m1)
170 
171  CALL mpi_comm_size(comm_one_d(2), nb_procs_les, code)
172  bloc_size_les = vv_mesh%gauss%l_G*vv_mesh%dom_me/nb_procs_les+1
173  bloc_size_les = vv_mesh%gauss%l_G*(bloc_size_les/vv_mesh%gauss%l_G)+vv_mesh%gauss%l_G
174  m_max_pad_les = 3*SIZE(list_mode)*nb_procs_les/2
175  ALLOCATE(visc_entro_real(2*m_max_pad_les-1,bloc_size_les))
176  visc_entro_real = 0.d0
177 
178  !---------PREPARE pp_js_D ARRAY FOR PRESSURE-----------------------------------
179  !CALL dirichlet_nodes_parallel(pp_mesh, inputs%pp_list_dirichlet_sides, pp_js_D)
180  !------------------------------------------------------------------------------
181  !===PREPARE pp_mode_global_js_D ARRAY FOR PRESSURE
182  !===ATTENTION pressure BCs are no longer implemented
183  !===JLG June 9 2017
184  !CALL scalar_glob_js_D(pp_mesh, list_mode, pp_1_LA, pp_mode_global_js_D)
185  CALL scalar_without_glob_js_d(pp_mesh, list_mode, pp_1_la, pp_mode_global_js_d)
186  ALLOCATE(pp_global_d(m_max_c))
187  DO i = 1, m_max_c
188  ALLOCATE(pp_global_d(i)%DRL(SIZE(pp_mode_global_js_d(i)%DIL)))
189  END DO
190 
191  !===PREPARE TYPE OF BOUNDARY CONDITIONS AND js_D ARRAY FOR VELOCITY
192  CALL vector_glob_js_d(vv_mesh, list_mode, vv_3_la, inputs%vv_list_dirichlet_sides, &
193  vv_js_d, vv_mode_global_js_d)
194 
195  ALLOCATE(vel_global_d(m_max_c))
196  DO i = 1, m_max_c
197  ALLOCATE(vel_global_d(i)%DRL(SIZE(vv_mode_global_js_d(i)%DIL)))
198  END DO
199  !===END PREPARE TYPE OF BOUNDARY CONDITIONS AND js_D ARRAY FOR VELOCITY
200 
201  !===ASSEMBLE MASS MATRIX
202  CALL create_local_petsc_matrix(comm_one_d(1), pp_1_la, mass_mat, clean=.false.)
203  CALL qs_diff_mass_scal_m (pp_mesh, pp_1_la, 0.d0, 1.d0, 0.d0, 0, mass_mat)
204  DO i = 1, m_max_c
205  IF (list_mode(i)==0) cycle
206  CALL dirichlet_m_parallel(mass_mat,pp_mode_global_js_d(i)%DIL)
207  END DO
208  CALL init_solver(inputs%my_par_mass,mass_ksp,mass_mat,comm_one_d(1),&
209  solver=inputs%my_par_mass%solver,precond=inputs%my_par_mass%precond)
210 
211  IF (minval(list_mode)==0) THEN
212  CALL create_local_petsc_matrix(comm_one_d(1), pp_1_la, mass_mat0, clean=.false.)
213  CALL qs_diff_mass_scal_m (pp_mesh, pp_1_la, 0.d0, 1.d0, 0.d0, 0, mass_mat0)
214  DO i = 1, m_max_c
215  IF (list_mode(i).NE.0) cycle
216  CALL dirichlet_m_parallel(mass_mat0,pp_mode_global_js_d(i)%DIL)
217  CALL init_solver(inputs%my_par_mass,mass_ksp0,mass_mat0,comm_one_d(1),&
218  solver=inputs%my_par_mass%solver,precond=inputs%my_par_mass%precond)
219  END DO
220  END IF
221  !===END ASSEMBLE MASS MATRIX
222 
223  !-------------ASSEMBLE VELOCITY MATRICES----------------------
224  ALLOCATE(vel_mat(2*m_max_c),vel_ksp(2*m_max_c))
225  ALLOCATE(press_mat(m_max_c),press_ksp(m_max_c))
226 
227  ! Definition of nu_bar
228  IF (inputs%if_level_set) THEN
229  !To be tested thoroughly
230  mu_bar = minval(inputs%dyna_visc_fluid)
231  rho_bar = minval(inputs%density_fluid)
232  nu_bar = 0.d0
233  DO n = 1, inputs%nb_fluid
234  nu_bar = max(nu_bar,inputs%dyna_visc_fluid(n)/inputs%density_fluid(n))
235  END DO
236  nu_bar = 2.d0*nu_bar
237  ELSE
238  mu_bar = 1.d0
239  nu_bar = 1.d0
240  rho_bar = 1.d0
241  END IF
242 
243  DO i = 1, m_max_c
244  mode = list_mode(i)
245  !---VELOCITY
246  nu_mat = 2*i-1
247  CALL create_local_petsc_matrix(comm_one_d(1), vv_3_la, vel_mat(nu_mat), clean=.false.)
248  IF (inputs%if_moment_bdf2) THEN
249  CALL qs_diff_mass_vect_3x3 (1, vv_3_la, vv_mesh, nu_bar/re, three/(2*dt), &
250  inputs%LES_coeff1_mom, inputs%stab_bdy_ns, i, mode, vel_mat(nu_mat))
251  ELSE
252  CALL qs_diff_mass_vect_3x3 (1, vv_3_la, vv_mesh, nu_bar/re, one/dt, &
253  inputs%LES_coeff1_mom, inputs%stab_bdy_ns, i, mode, vel_mat(nu_mat))
254  END IF
255  CALL dirichlet_m_parallel(vel_mat(nu_mat),vv_mode_global_js_d(i)%DIL)
256  CALL init_solver(inputs%my_par_vv,vel_ksp(nu_mat),vel_mat(nu_mat),comm_one_d(1),&
257  solver=inputs%my_par_vv%solver,precond=inputs%my_par_vv%precond)
258 
259  nu_mat = nu_mat+1
260  CALL create_local_petsc_matrix(comm_one_d(1), vv_3_la, vel_mat(nu_mat), clean=.false.)
261  IF (inputs%if_moment_bdf2) THEN
262  CALL qs_diff_mass_vect_3x3 (2, vv_3_la, vv_mesh, nu_bar/re, three/(2*dt), &
263  inputs%LES_coeff1_mom, inputs%stab_bdy_ns, i, mode, vel_mat(nu_mat))
264  ELSE
265  CALL qs_diff_mass_vect_3x3 (2, vv_3_la, vv_mesh, nu_bar/re, one/dt, &
266  inputs%LES_coeff1_mom, inputs%stab_bdy_ns, i, mode, vel_mat(nu_mat))
267  END IF
268  CALL dirichlet_m_parallel(vel_mat(nu_mat),vv_mode_global_js_d(i)%DIL)
269  CALL init_solver(inputs%my_par_vv,vel_ksp(nu_mat),vel_mat(nu_mat),comm_one_d(1),&
270  solver=inputs%my_par_vv%solver,precond=inputs%my_par_vv%precond)
271 
272  !---PRESSURE
273  CALL create_local_petsc_matrix(comm_one_d(1), pp_1_la, press_mat(i), clean=.false.)
274  CALL qs_diff_mass_scal_m(pp_mesh, pp_1_la, one, 1.d-10, zero, mode, press_mat(i))
275  CALL dirichlet_m_parallel(press_mat(i),pp_mode_global_js_d(i)%DIL)
276  CALL init_solver(inputs%my_par_pp,press_ksp(i),press_mat(i),comm_one_d(1),&
277  solver=inputs%my_par_pp%solver,precond=inputs%my_par_pp%precond)
278 
279  ENDDO
280 
281  CALL twod_volume(comm_one_d(1),vv_mesh,sqrt_2d_vol)
282  sqrt_2d_vol = sqrt(sqrt_2d_vol)
283 
284  ENDIF ! Fin du once
285  tps_tot = user_time()
286  tps_cumul = 0
287 
288 
289  !===Compute rhs by FFT at Gauss points
290  tps = user_time()
291 
292  IF (inputs%if_moment_bdf2) THEN
293  uext = 2*un-un_m1
294  IF (inputs%if_level_set) THEN
295  ! BDF2: momentumext = rho_np1*(2*un-un_m1)
296  CALL fft_scalar_vect_dcl(comm_one_d(2), uext, density_p1, momentumext, 1,nb_procs, &
297  bloc_size, m_max_pad)
298  ELSE
299  momentumext = 2*momentum - momentum_m1
300  END IF
301  ELSE
302  uext = un
303  IF (inputs%if_level_set) THEN
304  ! BDF1: momentumext = rho_np1*un
305  CALL fft_scalar_vect_dcl(comm_one_d(2), un, density_p1, momentumext, 1, nb_procs, &
306  bloc_size, m_max_pad)
307  ELSE
308  momentumext = momentum
309  END IF
310  END IF
311 
312  !===Precession should be in condlim
313  IF (inputs%precession) THEN
314  CALL error_petsc('for momentum ns : precession should be in condlim')
315  END IF
316 
317  !===Compute Lorentz force if mhd
318  IF (inputs%type_pb=='mhd') THEN
319  !===Compute Lorentz force if mhd in quasi-static limit
320  IF (inputs%if_quasi_static_approx) THEN
321  DO i = 1, m_max_c
322  mode = list_mode(i)
323  hn_p2_aux(:,:,i) = h_b_quasi_static('H', vv_mesh%rr, mode)
324  END DO
325  CALL smb_curlh_cross_b_gauss_sft_par(comm_one_d(2),vv_mesh,list_mode,hn_p2_aux,bn_p2,rotb_b_aux)
326  DO i = 1, m_max_c
327  mode = list_mode(i)
328  hn_p2_aux(:,:,i) = h_b_quasi_static('B', vv_mesh%rr, mode)
329  END DO
330  CALL smb_curlh_cross_b_gauss_sft_par(comm_one_d(2),vv_mesh,list_mode,hn_p2,hn_p2_aux,rotb_b)
331  rotb_b = rotb_b + rotb_b_aux
332  ELSE !===Compute Lorentz force if mhd
333  CALL smb_curlh_cross_b_gauss_sft_par(comm_one_d(2),vv_mesh,list_mode,hn_p2,bn_p2,rotb_b)
334  END IF
335  ELSE
336  rotb_b = 0.d0
337  END IF
338  !===End compute Lorentz force if mhd
339 
340  IF (inputs%if_level_set) THEN
341  !===Compute visco_dyn/Re*Grad(un)
342  CALL smb_explicit_diffu_sym(comm_one_d(2), vv_mesh, list_mode, nb_procs, &
343  visco_dyn/re, un, visc_grad_vel)
344  !===End compute visco_dyn/Re*Grad(un)
345 
346  !===Compute (-LES_coeff1+visc_entro)*Grad(momentumext)
347  IF (inputs%LES.AND.inputs%if_LES_in_momentum) THEN
348  CALL smb_explicit_les(comm_one_d(2), vv_mesh, list_mode, nb_procs, &
349  visc_entro_real, momentumext, visc_entro_grad_mom)
350  ELSE
351  visc_entro_grad_mom=0.d0
352  END IF
353  !===End compute (-LES_coeff1+visc_entro)*Grad(momentumext)
354 
355  IF (inputs%if_surface_tension) THEN
356  !===Compute coeff_surface*Grad(level_set):Grad(level_set)
357  IF (inputs%if_level_set_P2) THEN
358  CALL smb_surface_tension(comm_one_d(2), vv_mesh, list_mode, nb_procs, &
359  level_set_p1, tensor_surface_gauss)
360  ELSE
361  DO nb_inter = 1, inputs%nb_fluid-1
362  DO i = 1, SIZE(list_mode)
363  DO k = 1, 2
364  CALL inject_p1_p2(pp_mesh%jj, vv_mesh%jj, level_set_p1(nb_inter,:,k,i), &
365  level_set_fem_p2(nb_inter,:,k,i))
366  END DO
367  END DO
368  END DO
369  CALL smb_surface_tension(comm_one_d(2), vv_mesh, list_mode, nb_procs, &
370  level_set_fem_p2, tensor_surface_gauss)
371  END IF
372  ELSE
373  tensor_surface_gauss = 0.d0
374  END IF
375  ELSE
376  visc_grad_vel = 0.d0
377  tensor_surface_gauss = 0.d0
378  END IF
379 
380  !===Compute tensor product of momentum by velocity
381  CALL fft_tensor_dcl(comm_one_d(2), momentum, un, tensor, nb_procs, bloc_size, m_max_pad)
382 
383  !===PREPARE BOUNDARY CONDITION FOR MOMENTUM
384  CALL momentum_dirichlet(comm_one_d(2), vv_mesh, list_mode, time, nb_procs,density_p1, &
385  momentum_exact, vv_js_d)
386 
387  tps = user_time() - tps; tps_cumul=tps_cumul+tps
388  !WRITE(*,*) ' Tps fft vitesse', tps
389 
390  !------------DEBUT BOUCLE SUR LES MODES----------------
391  DO i = 1, m_max_c
392  mode = list_mode(i)
393  !===Compute phi
394  tps = user_time()
395  !jan 29 2007
396  pn_p1(:,:) = pn(:,:,i)
397  IF (inputs%if_moment_bdf2) THEN
398  phi = pn_p1(:,:) + (4.d0 * incpn(:,:,i) - incpn_m1(:,:,i))/3.d0
399  ELSE
400  phi = pn_p1(:,:) + incpn(:,:,i)
401  END IF
402  !jan 29 2007
403 
404  !===Inject pressure P1 -> P2
405  DO k = 1, 2
406  CALL inject(pp_mesh%jj, vv_mesh%jj, phi(:,k), p_p2(:,k))
407  ENDDO
408 
409  !===Prediction step
410  DO k=1,6
411  IF (inputs%if_temperature) THEN
412  src(:,k) = source_in_ns_momentum(k, vv_mesh%rr, mode, i, time, re, 'ns', &
413  opt_density=density_p1, opt_tempn=tempn)
414  ELSE
415  src(:,k) = source_in_ns_momentum(k, vv_mesh%rr, mode, i, time, re, 'ns', &
416  opt_density=density_p1)
417  END IF
418  END DO
419 
420  IF (inputs%if_moment_bdf2) THEN
421  tensor_ext = 2*tensor(:,:,:,i) - tensor_m1(:,:,:,i)
422  visc_grad_vel_ext = 2*visc_grad_vel(:,:,:,i) - visc_grad_vel_m1(:,:,:,i)
423 
424  !===Update terms at m1
425  rotb_b_m1(:,:,i) = rotb_b(:,:,i)
426  tensor_m1(:,:,:,i) = tensor(:,:,:,i)
427  visc_grad_vel_m1(:,:,:,i) = visc_grad_vel(:,:,:,i)
428  CALL qs_ns_momentum_stab_3x3(vv_mesh, vv_3_la, mode, src, &
429  (4*momentum(:,:,i)-momentum_m1(:,:,i))/(2*dt), p_p2(:,:), &
430  vb_3_145, vb_3_236, rotb_b(:,:,i), tensor_ext,&
431  tensor_surface_gauss(:,:,:,i), nu_bar/re, momentumext(:,:,i), &
432  -visc_grad_vel_ext-visc_entro_grad_mom(:,:,:,i))
433  ELSE
434  CALL qs_ns_momentum_stab_3x3(vv_mesh, vv_3_la, mode, src, &
435  momentum(:,:,i)/dt, p_p2(:,:), &
436  vb_3_145, vb_3_236, rotb_b(:,:,i), tensor(:,:,:,i),&
437  tensor_surface_gauss(:,:,:,i), nu_bar/re, momentumext(:,:,i), &
438  -visc_grad_vel(:,:,:,i)-visc_entro_grad_mom(:,:,:,i))
439  END IF
440 
441  !===Axis boundary conditions
442  n1 = SIZE(vv_js_d(1)%DIL)
443  n2 = SIZE(vv_js_d(2)%DIL)
444  n3 = SIZE(vv_js_d(3)%DIL)
445  n123 = n1+n2+n3
446  vel_global_d(i)%DRL(1:n1) = momentum_exact(vv_js_d(1)%DIL,1,i)
447  vel_global_d(i)%DRL(n1+1:n1+n2) = momentum_exact(vv_js_d(2)%DIL,4,i)
448  vel_global_d(i)%DRL(n1+n2+1:n123)= momentum_exact(vv_js_d(3)%DIL,5,i)
449  vel_global_d(i)%DRL(n123+1:) = 0.d0
450  CALL dirichlet_rhs(vv_mode_global_js_d(i)%DIL-1,vel_global_d(i)%DRL,vb_3_145)
451  vel_global_d(i)%DRL(1:n1) = momentum_exact(vv_js_d(1)%DIL,2,i)
452  vel_global_d(i)%DRL(n1+1:n1+n2) = momentum_exact(vv_js_d(2)%DIL,3,i)
453  vel_global_d(i)%DRL(n1+n2+1:n123)= momentum_exact(vv_js_d(3)%DIL,6,i)
454  CALL dirichlet_rhs(vv_mode_global_js_d(i)%DIL-1,vel_global_d(i)%DRL,vb_3_236)
455  tps = user_time() - tps; tps_cumul=tps_cumul+tps
456  !===End Assemble vb_3_145, vb_3_236 using rhs_gauss
457 
458 
459  tps = user_time() - tps; tps_cumul=tps_cumul+tps
460  !WRITE(*,*) ' Tps second membre vitesse', tps
461  !-------------------------------------------------------------------------------------
462 
463  !--------------------INVERSION DE L'OPERATEUR 1 --------------
464  tps = user_time()
465  !Solve system 1, ur_c, ut_s, uz_c
466  nu_mat =2*i-1
467  CALL solver(vel_ksp(nu_mat),vb_3_145,vx_3,reinit=.false.,verbose=inputs%my_par_vv%verbose)
468  CALL vecghostupdatebegin(vx_3,insert_values,scatter_forward,ierr)
469  CALL vecghostupdateend(vx_3,insert_values,scatter_forward,ierr)
470  CALL extract(vx_3_ghost,1,1,vv_3_la,un_p1(:,1))
471  CALL extract(vx_3_ghost,2,2,vv_3_la,un_p1(:,4))
472  CALL extract(vx_3_ghost,3,3,vv_3_la,un_p1(:,5))
473 
474  !Solve system 2, ur_s, ut_c, uz_s
475  nu_mat = nu_mat + 1
476  CALL solver(vel_ksp(nu_mat),vb_3_236,vx_3,reinit=.false.,verbose=inputs%my_par_vv%verbose)
477  CALL vecghostupdatebegin(vx_3,insert_values,scatter_forward,ierr)
478  CALL vecghostupdateend(vx_3,insert_values,scatter_forward,ierr)
479  CALL extract(vx_3_ghost,1,1,vv_3_la,un_p1(:,2))
480  CALL extract(vx_3_ghost,2,2,vv_3_la,un_p1(:,3))
481  CALL extract(vx_3_ghost,3,3,vv_3_la,un_p1(:,6))
482 
483  tps = user_time() - tps; tps_cumul=tps_cumul+tps
484  !WRITE(*,*) ' Tps solution des pb de vitesse', tps, 'for mode ', mode
485  !-------------------------------------------------------------------------------------
486 
487  !JLG AR, Dec 18 2008/JLG Bug corrige Jan 23 2010
488  IF (mode==0) THEN
489  un_p1(:,2) = 0.d0
490  un_p1(:,4) = 0.d0
491  un_p1(:,6) = 0.d0
492  pn_p1(:,2) = 0.d0
493  END IF
494  !JLG AR, Dec 18 2008/JLG Bug corrige Jan 23 2010
495 
496  momentum_m2(:,:,i) = momentum_m1(:,:,i)
497  momentum_m1(:,:,i) = momentum(:,:,i)
498  momentum(:,:,i) = un_p1
499 
500  END DO
501 
502  !---------------UPDATE VELOCITY---------------------
503  un_m1 = un
504  IF (inputs%if_level_set) THEN
505  CALL fft_scalar_vect_dcl(comm_one_d(2), momentum, density_p1, un, 2, nb_procs, &
506  bloc_size, m_max_pad)
507  ELSE
508  un = momentum
509  END IF
510 
511 
512  DO i = 1, m_max_c
513  mode = list_mode(i)
514  !===Compute phi
515  tps = user_time()
516  !jan 29 2007
517  pn_p1(:,:) = pn(:,:,i)
518  !jan 29 2007
519 
520  !---------------SOLUTION OF THE POISSON EQUATION--------------
521  ! BDF2 : solve -LAP(PH3) = -3*rho_bar/(2*dt)*DIV(un_p1)
522  ! BDF1 : solve -LAP(PH3) = -rho_bar/dt*DIV(un_p1)
523  tps = user_time()
524  CALL qs_01_div_hybrid_2006(vv_mesh, pp_mesh, pp_1_la, mode, un(:,:,i), pb_1, pb_2)
525  !pb_1, and pb_2 are petsc vectors for the rhs divergence
526 
527  !===ATENTION BCs are no longer implemented for pressure
528  !===Boundary condition on axis for pressure
529  pp_global_d(i)%DRL = 0.d0
530  CALL dirichlet_rhs(pp_mode_global_js_d(i)%DIL-1,pp_global_d(i)%DRL,pb_1)
531  CALL dirichlet_rhs(pp_mode_global_js_d(i)%DIL-1,pp_global_d(i)%DRL,pb_2)
532  !===End boundary condition on axis for pressure
533 
534  CALL solver(press_ksp(i),pb_1,px_1,reinit=.false.,verbose=inputs%my_par_pp%verbose)
535  CALL vecghostupdatebegin(px_1,insert_values,scatter_forward,ierr)
536  CALL vecghostupdateend(px_1,insert_values,scatter_forward,ierr)
537  CALL extract(px_1_ghost,1,1,pp_1_la,phi(:,1))
538 
539  CALL solver(press_ksp(i),pb_2,px_1,reinit=.false.,verbose=inputs%my_par_pp%verbose)
540  CALL vecghostupdatebegin(px_1,insert_values,scatter_forward,ierr)
541  CALL vecghostupdateend(px_1,insert_values,scatter_forward,ierr)
542  CALL extract(px_1_ghost,1,1,pp_1_la,phi(:,2))
543 
544  !Don't forget the -(1.5d0/dt)*min(rh0) coefficient
545  IF (inputs%if_moment_bdf2) THEN
546  phi = -phi*(1.5d0/dt)*rho_bar
547  ELSE
548  phi = -phi/dt*rho_bar
549  END IF
550  tps = user_time() - tps; tps_cumul=tps_cumul+tps
551  !WRITE(*,*) ' Tps solution des pb de pression', tps, 'for mode ', mode
552  !-------------------------------------------------------------------------------------
553 
554 
555  !---------------CORRECTION DE LA PRESSION-----------------------
556  tps = user_time()
557  !CALL solver(mass_ksp,pb_1,px_1,reinit=.FALSE.,verbose=inputs%my_par_mass%verbose)
558  IF (mode==0) THEN
559  CALL solver(mass_ksp0,pb_1,px_1,reinit=.false.,verbose=inputs%my_par_mass%verbose)
560  ELSE
561  CALL solver(mass_ksp,pb_1,px_1,reinit=.false.,verbose=inputs%my_par_mass%verbose)
562  END IF
563  CALL vecghostupdatebegin(px_1,insert_values,scatter_forward,ierr)
564  CALL vecghostupdateend(px_1,insert_values,scatter_forward,ierr)
565  CALL extract(px_1_ghost,1,1,pp_1_la,div(:,1,i))
566 
567  !CALL solver(mass_ksp,pb_2,px_1,reinit=.FALSE.,verbose=inputs%my_par_mass%verbose)
568  IF (mode==0) THEN
569  CALL solver(mass_ksp0,pb_2,px_1,reinit=.false.,verbose=inputs%my_par_mass%verbose)
570  ELSE
571  CALL solver(mass_ksp,pb_2,px_1,reinit=.false.,verbose=inputs%my_par_mass%verbose)
572  END IF
573  CALL vecghostupdatebegin(px_1,insert_values,scatter_forward,ierr)
574  CALL vecghostupdateend(px_1,insert_values,scatter_forward,ierr)
575  CALL extract(px_1_ghost,1,1,pp_1_la,div(:,2,i))
576 
577  !Pressure computation
578  !jan 29 2007
579  DO k=1, 2
580  pn_p1(:,k) = pn_p1(:,k) + phi(:,k) - div(:,k,i)*(mu_bar/re)
581  END DO
582  !jan 29 2007
583  tps = user_time() - tps; tps_cumul=tps_cumul+tps
584  !WRITE(*,*) ' Tps correction de divergence', tps
585  !-------------------------------------------------------------------------------------
586 
587  !---------------UPDATE PRESSURE---------------------
588  tps = user_time()
589  IF (mode == 0) THEN
590  CALL moy(comm_one_d(1),pp_mesh, pn_p1(:,1),moyenne)
591  pn_p1(:,1) = pn_p1(:,1)-moyenne
592  ENDIF
593 
594  !JLG AR, Dec 18 2008/JLG Bug corrige Jan 23 2010
595  IF (mode==0) THEN
596  pn_p1(:,2) = 0.d0
597  END IF
598  !JLG AR, Dec 18 2008/JLG Bug corrige Jan 23 2010
599 
600  pn_m1(:,:,i) = pn(:,:,i)
601  pn(:,:,i) = pn_p1
602 
603  incpn_m1(:,:,i) = incpn(:,:,i)
604  incpn(:,:,i) = phi
605 
606  tps = user_time() - tps; tps_cumul=tps_cumul+tps
607  !WRITE(*,*) ' Tps des updates', tps
608  !-------------------------------------------------------------------------------------
609 
610  ENDDO
611  tps_tot = user_time() - tps_tot
612 
613  !===Verbose divergence of velocity
614  IF (inputs%verbose_divergence) THEN
615  norm = norm_sf(comm_one_d, 'H1', vv_mesh, list_mode, un)
616  talk_to_me%div_L2 = norm_sf(comm_one_d, 'div', vv_mesh, list_mode, un)/norm
617  talk_to_me%weak_div_L2 = norm_sf(comm_one_d, 'L2', pp_mesh, list_mode, div)/norm
618  END IF
619  !===End verbose divergence of velocity
620 
621  !===Compute vel max and CFL
622  IF (inputs%verbose_CFL.OR.inputs%LES) THEN
623  vel_loc = 0.d0
624  DO i = 1, m_max_c
625  IF (list_mode(i)==0) THEN
626  coeff = 1.d0
627  ELSE
628  coeff = .5d0
629  END IF
630  vel_loc = vel_loc + coeff*(un(:,1,i)**2+un(:,2,i)**2+un(:,3,i)**2+&
631  un(:,4,i)**2+un(:,5,i)**2+un(:,6,i)**2)
632  END DO
633  CALL mpi_comm_size(comm_one_d(2),nb_procs,code)
634  CALL mpi_allreduce(vel_loc,vel_tot,vv_mesh%np,mpi_double_precision, mpi_sum, comm_one_d(2), code)
635 
636  vel_tot = sqrt(vel_tot)
637  vel_tot_max_s = maxval(vel_tot)
638  CALL mpi_allreduce(vel_tot_max_s,vel_tot_max,1,mpi_double_precision, mpi_max, comm_one_d(1), code)
639 
640  !===New normalization (JLG; April 24, 2015)
641  DO i = 1, m_max_c
642  normalization_mt(i) = norm_s(comm_one_d, 'L2', vv_mesh, list_mode, momentum)/(sqrt(2.d0)*sqrt_2d_vol)
643  END DO
644  !===New normalization (JLG; April 24, 2015)
645 
646  !===Computation of CFL
647  IF (inputs%verbose_CFL) THEN
648  cfl = 0
649  DO m = 1, vv_mesh%dom_me
650  cfl = max(vel_tot_max*dt/vv_mesh%hloc(m),cfl)
651  END DO
652  CALL mpi_allreduce(cfl,cfl_max,1,mpi_double_precision, mpi_max, comm_one_d(1), code)
653  talk_to_me%CFL=cfl_max
654  talk_to_me%time=time
655  !IF (my_petscworld_rank==0) THEN
656  ! WRITE(*,'(3(A,e10.3))') ' Time = ', time, ', CFL = ', cfl_max, 'vel_tot_max', vel_tot_max
657  !END IF
658  END IF
659  END IF
660 
661  !===Compute entropy viscosity
662  IF (inputs%if_level_set) THEN
663  IF (inputs%LES) THEN
664  CALL compute_entropy_viscosity_mom(comm_one_d, vv_3_la, vv_mesh, pp_mesh, time, list_mode, &
665  momentum, momentum_m1, momentum_m2, pn_m1, un_m1, tensor, visc_grad_vel, tensor_surface_gauss, &
666  rotb_b, visco_dyn, density_m1, density, density_p1, tempn, visc_entro_real, visc_entro_level)
667  ELSE
668  visc_entro_real = 0.d0
669  visc_entro_level= 0.d0
670  END IF
671  ELSE
672  IF (inputs%if_LES_in_momentum) THEN
673  CALL compute_entropy_viscosity_mom_no_level_set(comm_one_d, vv_3_la, vv_mesh, pp_mesh, time, list_mode, &
674  momentum, momentum_m1, momentum_m2, pn_m1, un_m1, tensor, rotb_b, tempn, visc_entro_real)
675  ELSE
676  visc_entro_real=0.d0
677  END IF
678  !visc_entro_level not allocated so nothing to do
679  END IF
680  !===End compute entropy viscosity
681 
682  !===Dummies variables to avoid warning
683  i=SIZE(level_set,1)
684  !===Dummies variables to avoid warning
685  END SUBROUTINE three_level_ns_tensor_sym_with_m
686  !============================================
687 
688  SUBROUTINE inject(jj_c, jj_f, pp_c, pp_f)
689  IMPLICIT NONE
690 
691  INTEGER, DIMENSION(:,:), INTENT(IN) :: jj_c, jj_f
692  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: pp_c
693  REAL(KIND=8), DIMENSION(:), INTENT(OUT) :: pp_f
694  REAL(KIND=8) :: half = 0.5
695  INTEGER:: m
696  IF (SIZE(jj_c,1)==3) THEN
697  DO m = 1, SIZE(jj_f,2)
698  pp_f(jj_f(1:3,m)) = pp_c(jj_c(:,m))
699  pp_f(jj_f(4,m)) = (pp_c(jj_c(2,m)) + pp_c(jj_c(3,m)))*half
700  pp_f(jj_f(5,m)) = (pp_c(jj_c(3,m)) + pp_c(jj_c(1,m)))*half
701  pp_f(jj_f(6,m)) = (pp_c(jj_c(1,m)) + pp_c(jj_c(2,m)))*half
702  END DO
703 
704  ELSE
705  DO m = 1, SIZE(jj_f,2)
706  pp_f(jj_f(1:4,m)) = pp_c(jj_c(:,m))
707  END DO
708  pp_f(jj_f(5,:)) = (pp_c(jj_c(3,:)) + pp_c(jj_c(4,:)))*half
709  pp_f(jj_f(6,:)) = (pp_c(jj_c(4,:)) + pp_c(jj_c(2,:)))*half
710  pp_f(jj_f(7,:)) = (pp_c(jj_c(2,:)) + pp_c(jj_c(3,:)))*half
711  pp_f(jj_f(8,:)) = (pp_c(jj_c(1,:)) + pp_c(jj_c(4,:)))*half
712  pp_f(jj_f(9,:)) = (pp_c(jj_c(3,:)) + pp_c(jj_c(1,:)))*half
713  pp_f(jj_f(10,:)) = (pp_c(jj_c(1,:)) + pp_c(jj_c(2,:)))*half
714 
715  END IF
716 
717  END SUBROUTINE inject
718 
719  SUBROUTINE smb_curlh_cross_b_gauss_sft_par(communicator,mesh,list_mode,V_in,W_in,V_out)
720  !=================================
721  USE sft_parallele
722  USE chaine_caractere
723  USE input_data
724  USE def_type_mesh
725  IMPLICIT NONE
726  TYPE(mesh_type), INTENT(IN) :: mesh
727  INTEGER, DIMENSION(:), INTENT(IN) :: list_mode
728  REAL(KIND=8), DIMENSION(:,:,:), INTENT(IN) :: V_in, W_in
729  REAL(KIND=8), DIMENSION(:,:,:) :: V_out
730  REAL(KIND=8), DIMENSION(mesh%gauss%l_G*mesh%me,6,SIZE(list_mode)) :: RotV, V, W
731  INTEGER, DIMENSION(mesh%gauss%n_w) :: j_loc
732  REAL(KIND=8), DIMENSION(mesh%gauss%k_d,mesh%gauss%n_w) :: dw_loc
733  INTEGER :: m, l , i, mode, index, k
734  REAL(KIND=8), DIMENSION(mesh%gauss%n_w,6) :: Vs, Ws
735  REAL(KIND=8) :: ray
736  REAL(KIND=8) :: tps
737  REAL(KIND=8), DIMENSION(3) :: temps
738 !===FOR FFT_PAR_CROSS_PROD_DCL
739  INTEGER :: nb_procs, bloc_size, m_max_pad, code
740  mpi_comm :: communicator
741 
742  tps = user_time()
743  DO i = 1, SIZE(list_mode)
744  mode = list_mode(i)
745  index = 0
746  DO m = 1, mesh%me
747  j_loc = mesh%jj(:,m)
748  DO k = 1, 6
749  vs(:,k) = v_in(j_loc,k,i)
750  ws(:,k) = w_in(j_loc,k,i)
751  END DO
752 
753  DO l = 1, mesh%gauss%l_G
754  index = index + 1
755  dw_loc = mesh%gauss%dw(:,:,l,m)
756 
757  !===Compute radius of Gauss point
758  ray = sum(mesh%rr(1,j_loc)*mesh%gauss%ww(:,l))
759 
760  !-----------------vitesse sur les points de Gauss---------------------------
761  w(index,1,i) = sum(ws(:,1)*mesh%gauss%ww(:,l))
762  w(index,3,i) = sum(ws(:,3)*mesh%gauss%ww(:,l))
763  w(index,5,i) = sum(ws(:,5)*mesh%gauss%ww(:,l))
764 
765  w(index,2,i) = sum(ws(:,2)*mesh%gauss%ww(:,l))
766  w(index,4,i) = sum(ws(:,4)*mesh%gauss%ww(:,l))
767  w(index,6,i) = sum(ws(:,6)*mesh%gauss%ww(:,l))
768  v(index,1,i) = sum(vs(:,1)*mesh%gauss%ww(:,l))
769  v(index,3,i) = sum(vs(:,3)*mesh%gauss%ww(:,l))
770  v(index,5,i) = sum(vs(:,5)*mesh%gauss%ww(:,l))
771 
772  v(index,2,i) = sum(vs(:,2)*mesh%gauss%ww(:,l))
773  v(index,4,i) = sum(vs(:,4)*mesh%gauss%ww(:,l))
774  v(index,6,i) = sum(vs(:,6)*mesh%gauss%ww(:,l))
775  !-----------------rotational sur les points de Gauss---------------------------
776  !coeff sur les cosinus
777  rotv(index,1,i) = mode/ray*v(index,6,i) &
778  -sum(vs(:,3)*dw_loc(2,:))
779  rotv(index,4,i) = sum(vs(:,2)*dw_loc(2,:)) &
780  -sum(vs(:,6)*dw_loc(1,:))
781  rotv(index,5,i) = 1/ray*v(index,3,i) &
782  +sum(vs(:,3)*dw_loc(1,:)) &
783  -mode/ray*v(index,2,i)
784  !coeff sur les sinus
785  rotv(index,2,i) =-mode/ray*v(index,5,i) &
786  -sum(vs(:,4)*dw_loc(2,:))
787  rotv(index,3,i) = sum(vs(:,1)*dw_loc(2,:)) &
788  -sum(vs(:,5)*dw_loc(1,:))
789  rotv(index,6,i) = 1/ray*v(index,4,i) &
790  +sum(vs(:,4)*dw_loc(1,:))&
791  +mode/ray*v(index,1,i)
792  ENDDO
793  ENDDO
794  END DO
795 
796  !tps = user_time() - tps
797  !WRITE(*,*) ' Tps dans la grande boucle', tps
798  !tps = user_time()
799  temps = 0
800 
801 
802  CALL mpi_comm_size(communicator, nb_procs, code)
803  bloc_size = SIZE(rotv,1)/nb_procs+1
804  m_max_pad = 3*SIZE(list_mode)*nb_procs/2
805 
806  CALL fft_par_cross_prod_dcl(communicator, rotv, w, v_out, nb_procs, bloc_size, m_max_pad, temps)
807  tps = user_time() - tps
808  !WRITE(*,*) ' Tps dans FFT_PAR_PROD_VECT', tps
809  !write(*,*) ' Temps de Comm ', temps(1)
810  !write(*,*) ' Temps de Calc ', temps(2)
811  !write(*,*) ' Temps de Chan ', temps(3)
812  !DEALLOCATE(Om, W, RotV)
813 
814  END SUBROUTINE smb_curlh_cross_b_gauss_sft_par
815 
816  SUBROUTINE smb_explicit_diffu_sym(communicator, mesh, list_mode, nb_procs, visc_dyn, vel, V_out)
818  USE sft_parallele
819  USE chaine_caractere
820  USE boundary
821  USE input_data
822  IMPLICIT NONE
823  TYPE(mesh_type), TARGET :: mesh
824  INTEGER, INTENT(IN) :: nb_procs
825  INTEGER, DIMENSION(:), INTENT(IN) :: list_mode
826  REAL(KIND=8), DIMENSION(:,:,:), INTENT(IN) :: visc_dyn
827  REAL(KIND=8), DIMENSION(:,:,:), INTENT(IN) :: vel
828  REAL(KIND=8), DIMENSION(3,mesh%gauss%l_G*mesh%dom_me,6,SIZE(list_mode)), INTENT(OUT) :: V_out
829  REAL(KIND=8), DIMENSION(mesh%gauss%l_G*mesh%dom_me,6,SIZE(list_mode)) :: grad1_vel, grad2_vel, grad3_vel
830  REAL(KIND=8), DIMENSION(mesh%gauss%l_G*mesh%dom_me,6,SIZE(list_mode)) :: gradT1_vel, gradT2_vel, gradT3_vel
831  REAL(KIND=8), DIMENSION(mesh%gauss%l_G*mesh%dom_me,6,SIZE(list_mode)) :: part_tensor_1, part_tensor_2
832  REAL(KIND=8), DIMENSION(mesh%gauss%l_G*mesh%dom_me,6,SIZE(list_mode)) :: part_visc_sym_grad_1
833  REAL(KIND=8), DIMENSION(mesh%gauss%l_G*mesh%dom_me,6,SIZE(list_mode)) :: part_visc_sym_grad_2
834  REAL(KIND=8), DIMENSION(mesh%gauss%l_G*mesh%dom_me,2,SIZE(list_mode)) :: visc_dyn_gauss
835  INTEGER, DIMENSION(mesh%gauss%n_w) :: j_loc
836  REAL(KIND=8), DIMENSION(mesh%gauss%k_d,mesh%gauss%n_w) :: dw_loc
837  REAL(KIND=8), DIMENSION(mesh%gauss%n_w,6) :: vel_loc
838  REAL(KIND=8) :: ray
839  INTEGER :: m, l , i, mode, index, k
840  INTEGER :: m_max_pad, bloc_size
841  mpi_comm :: communicator
842 
843  CALL gauss(mesh)
844 
845  DO i = 1, SIZE(list_mode)
846  mode = list_mode(i)
847  index = 0
848  DO m = 1, mesh%dom_me
849  j_loc = mesh%jj(:,m)
850  DO k = 1, 6
851  vel_loc(:,k) = vel(j_loc,k,i)
852  END DO
853  DO l = 1, l_g
854  index = index + 1
855  dw_loc = dw(:,:,l,m)
856 
857  !===Compute radius of Gauss point
858  ray = sum(mesh%rr(1,j_loc)*ww(:,l))
859 
860  !-----------------Dynamic viscosity on Gauss points---------------------------
861  visc_dyn_gauss(index,1,i) = sum(visc_dyn(j_loc,1,i)*ww(:,l))
862  visc_dyn_gauss(index,2,i) = sum(visc_dyn(j_loc,2,i)*ww(:,l))
863 
864  !-----------------Grad u_r on Gauss points------------------------------------
865  grad1_vel(index,1,i) = sum(vel_loc(:,1)*dw_loc(1,:))
866  grad1_vel(index,2,i) = sum(vel_loc(:,2)*dw_loc(1,:))
867  grad1_vel(index,3,i) = (mode*sum(vel_loc(:,2)*ww(:,l)) - sum(vel_loc(:,3)*ww(:,l)))/ray
868  grad1_vel(index,4,i) = (-mode*sum(vel_loc(:,1)*ww(:,l)) - sum(vel_loc(:,4)*ww(:,l)))/ray
869  grad1_vel(index,5,i) = sum(vel_loc(:,1)*dw_loc(2,:))
870  grad1_vel(index,6,i) = sum(vel_loc(:,2)*dw_loc(2,:))
871 
872  !-----------------Grad u_th on Gauss points-----------------------------------
873  grad2_vel(index,1,i) = sum(vel_loc(:,3)*dw_loc(1,:))
874  grad2_vel(index,2,i) = sum(vel_loc(:,4)*dw_loc(1,:))
875  grad2_vel(index,3,i) = (mode*sum(vel_loc(:,4)*ww(:,l)) + sum(vel_loc(:,1)*ww(:,l)))/ray
876  grad2_vel(index,4,i) = (-mode*sum(vel_loc(:,3)*ww(:,l)) + sum(vel_loc(:,2)*ww(:,l)))/ray
877  grad2_vel(index,5,i) = sum(vel_loc(:,3)*dw_loc(2,:))
878  grad2_vel(index,6,i) = sum(vel_loc(:,4)*dw_loc(2,:))
879 
880  !-----------------Grad u_z on Gauss points------------------------------------
881  grad3_vel(index,1,i) = sum(vel_loc(:,5)*dw_loc(1,:))
882  grad3_vel(index,2,i) = sum(vel_loc(:,6)*dw_loc(1,:))
883  grad3_vel(index,3,i) = mode*sum(vel_loc(:,6)*ww(:,l))/ray
884  grad3_vel(index,4,i) = -mode*sum(vel_loc(:,5)*ww(:,l))/ray
885  grad3_vel(index,5,i) = sum(vel_loc(:,5)*dw_loc(2,:))
886  grad3_vel(index,6,i) = sum(vel_loc(:,6)*dw_loc(2,:))
887  ENDDO
888  ENDDO
889  END DO
890 
891  IF (inputs%if_tensor_sym) THEN
892  !-----------------GradT u_r on Gauss points------------------------------------
893  gradt1_vel(:,1,:) = grad1_vel(:,1,:)
894  gradt1_vel(:,2,:) = grad1_vel(:,2,:)
895  gradt1_vel(:,3,:) = grad2_vel(:,1,:)
896  gradt1_vel(:,4,:) = grad2_vel(:,2,:)
897  gradt1_vel(:,5,:) = grad3_vel(:,1,:)
898  gradt1_vel(:,6,:) = grad3_vel(:,2,:)
899  !-----------------GradT u_th on Gauss points-----------------------------------
900  gradt2_vel(:,1,:) = grad1_vel(:,3,:)
901  gradt2_vel(:,2,:) = grad1_vel(:,4,:)
902  gradt2_vel(:,3,:) = grad2_vel(:,3,:)
903  gradt2_vel(:,4,:) = grad2_vel(:,4,:)
904  gradt2_vel(:,5,:) = grad3_vel(:,3,:)
905  gradt2_vel(:,6,:) = grad3_vel(:,4,:)
906  !-----------------GradT u_z on Gauss points------------------------------------
907  gradt3_vel(:,1,:) = grad1_vel(:,5,:)
908  gradt3_vel(:,2,:) = grad1_vel(:,6,:)
909  gradt3_vel(:,3,:) = grad2_vel(:,5,:)
910  gradt3_vel(:,4,:) = grad2_vel(:,6,:)
911  gradt3_vel(:,5,:) = grad3_vel(:,5,:)
912  gradt3_vel(:,6,:) = grad3_vel(:,6,:)
913 
914  !===Grad = Grad + Grad^T
915  grad1_vel = grad1_vel + gradt1_vel
916  grad2_vel = grad2_vel + gradt2_vel
917  grad3_vel = grad3_vel + gradt3_vel
918  END IF
919 
920  !===Compute (visc_dyn + nu_entro)*Grad^s(vel)
921  part_tensor_1 = grad1_vel(:,:,:)
922  part_tensor_2(:,1:4,:) = grad2_vel(:,3:6,:)
923  part_tensor_2(:,5:6,:) = grad3_vel(:,5:6,:)
924 
925  m_max_pad = 3*SIZE(list_mode)*nb_procs/2
926  bloc_size = SIZE(grad1_vel,1)/nb_procs+1
927  CALL fft_compute_diffu_mom(communicator,part_tensor_1, part_tensor_2, visc_dyn_gauss, &
928  part_visc_sym_grad_1, part_visc_sym_grad_2, nb_procs, bloc_size, m_max_pad)
929 
930  !===Using strain rate tensor symmetry to get V1_out= visc_dyn*Grad^s(vel)
931  v_out(1,:,:,:) = part_visc_sym_grad_1
932  v_out(2,:,1:2,:) = part_visc_sym_grad_1(:,3:4,:)
933  v_out(2,:,3:6,:) = part_visc_sym_grad_2(:,1:4,:)
934  v_out(3,:,1:2,:) = part_visc_sym_grad_1(:,5:6,:)
935  v_out(3,:,3:4,:) = part_visc_sym_grad_2(:,3:4,:)
936  v_out(3,:,5:6,:) = part_visc_sym_grad_2(:,5:6,:)
937 
938  END SUBROUTINE smb_explicit_diffu_sym
939 
940  SUBROUTINE smb_explicit_les(communicator, mesh, list_mode, nb_procs, visc_entro_real, mom, V_out)
942  USE sft_parallele
943  USE chaine_caractere
944  USE boundary
945  USE input_data
946  IMPLICIT NONE
947  TYPE(mesh_type), TARGET :: mesh
948  INTEGER, INTENT(IN) :: nb_procs
949  INTEGER, DIMENSION(:), INTENT(IN) :: list_mode
950  REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: visc_entro_real
951  REAL(KIND=8), DIMENSION(:,:,:), INTENT(IN) :: mom
952  REAL(KIND=8), DIMENSION(3,mesh%gauss%l_G*mesh%dom_me,6,SIZE(list_mode)), INTENT(OUT) :: V_out
953  REAL(KIND=8), DIMENSION(mesh%gauss%l_G*mesh%dom_me,6,SIZE(list_mode)) :: grad1_mom, grad2_mom, grad3_mom
954  INTEGER, DIMENSION(mesh%gauss%n_w) :: j_loc
955  REAL(KIND=8), DIMENSION(mesh%gauss%k_d,mesh%gauss%n_w) :: dw_loc
956  REAL(KIND=8), DIMENSION(mesh%gauss%n_w,6) :: mom_loc
957  REAL(KIND=8) :: ray, hh, hm
958  INTEGER :: m, l , i, mode, index, k
959  INTEGER :: m_max_pad, bloc_size
960  mpi_comm :: communicator
961 
962  CALL gauss(mesh)
963 
964  DO i = 1, SIZE(list_mode)
965  mode = list_mode(i)
966  index = 0
967  DO m = 1, mesh%dom_me
968  j_loc = mesh%jj(:,m)
969  DO k = 1, 6
970  mom_loc(:,k) = mom(j_loc,k,i)
971  END DO
972  DO l = 1, l_g
973  index = index + 1
974  dw_loc = dw(:,:,l,m)
975 
976  !===Compute local mesh sizes
977  hh=mesh%hloc_gauss(index)
978  hm=min(mesh%hm(i),hh) !WRONG choice
979  !hm=0.5d0/inputs%m_max
980  !hm=mesh%hm(i) !(JLG April 7 2017)
981 
982  !===Compute radius of Gauss point
983  ray = sum(mesh%rr(1,j_loc)*ww(:,l))
984 
985  !-----------------Grad mom_r on Gauss points------------------------------------
986  grad1_mom(index,1,i) = sum(mom_loc(:,1)*dw_loc(1,:))*hh
987  grad1_mom(index,2,i) = sum(mom_loc(:,2)*dw_loc(1,:))*hh
988  grad1_mom(index,3,i) = (mode*sum(mom_loc(:,2)*ww(:,l)) - &
989  sum(mom_loc(:,3)*ww(:,l)))/ray*hm
990  grad1_mom(index,4,i) = (-mode*sum(mom_loc(:,1)*ww(:,l)) - &
991  sum(mom_loc(:,4)*ww(:,l)))/ray*hm
992  grad1_mom(index,5,i) = sum(mom_loc(:,1)*dw_loc(2,:))*hh
993  grad1_mom(index,6,i) = sum(mom_loc(:,2)*dw_loc(2,:))*hh
994 
995  !-----------------Grad mom_th on Gauss points-----------------------------------
996  grad2_mom(index,1,i) = sum(mom_loc(:,3)*dw_loc(1,:))*hh
997  grad2_mom(index,2,i) = sum(mom_loc(:,4)*dw_loc(1,:))*hh
998  grad2_mom(index,3,i) = (mode*sum(mom_loc(:,4)*ww(:,l)) + &
999  sum(mom_loc(:,1)*ww(:,l)))/ray*hm
1000  grad2_mom(index,4,i) = (-mode*sum(mom_loc(:,3)*ww(:,l)) + &
1001  sum(mom_loc(:,2)*ww(:,l)))/ray*hm
1002  grad2_mom(index,5,i) = sum(mom_loc(:,3)*dw_loc(2,:))*hh
1003  grad2_mom(index,6,i) = sum(mom_loc(:,4)*dw_loc(2,:))*hh
1004 
1005  !-----------------Grad mom_z on Gauss points------------------------------------
1006  grad3_mom(index,1,i) = sum(mom_loc(:,5)*dw_loc(1,:))*hh
1007  grad3_mom(index,2,i) = sum(mom_loc(:,6)*dw_loc(1,:))*hh
1008  grad3_mom(index,3,i) = mode*sum(mom_loc(:,6)*ww(:,l))/ray*hm
1009  grad3_mom(index,4,i) = -mode*sum(mom_loc(:,5)*ww(:,l))/ray*hm
1010  grad3_mom(index,5,i) = sum(mom_loc(:,5)*dw_loc(2,:))*hh
1011  grad3_mom(index,6,i) = sum(mom_loc(:,6)*dw_loc(2,:))*hh
1012  ENDDO
1013  ENDDO
1014  END DO
1015 
1016  m_max_pad = 3*SIZE(list_mode)*nb_procs/2
1017  bloc_size = SIZE(grad1_mom,1)/nb_procs+1
1018  bloc_size = mesh%gauss%l_G*(bloc_size/mesh%gauss%l_G)+mesh%gauss%l_G
1019  CALL fft_compute_entropy_visc_grad_mom(communicator,grad1_mom, grad2_mom, grad3_mom, visc_entro_real, &
1020  v_out, nb_procs, bloc_size, m_max_pad)
1021 
1022  END SUBROUTINE smb_explicit_les
1023 
1024  SUBROUTINE smb_surface_tension(communicator, mesh, list_mode, nb_procs, level_set, tensor_surface_gauss)
1026  USE sft_parallele
1027  USE chaine_caractere
1028  USE boundary
1029  USE input_data
1030  IMPLICIT NONE
1031  TYPE(mesh_type), TARGET :: mesh
1032  INTEGER, INTENT(IN) :: nb_procs
1033  INTEGER, DIMENSION(:), INTENT(IN) :: list_mode
1034  REAL(KIND=8), DIMENSION(:,:,:,:), INTENT(IN) :: level_set
1035  REAL(KIND=8), DIMENSION(3,mesh%gauss%l_G*mesh%dom_me,6,SIZE(list_mode)), INTENT(OUT) :: tensor_surface_gauss
1036  REAL(KIND=8), DIMENSION(3,mesh%gauss%l_G*mesh%dom_me,6,SIZE(list_mode)) :: tensor
1037  REAL(KIND=8), DIMENSION(mesh%gauss%l_G*mesh%dom_me,6,SIZE(list_mode)) :: grad_level
1038  INTEGER, DIMENSION(mesh%gauss%n_w) :: j_loc
1039  REAL(KIND=8), DIMENSION(mesh%gauss%k_d,mesh%gauss%n_w) :: dw_loc
1040  REAL(KIND=8), DIMENSION(mesh%gauss%n_w,2) :: level_set_loc
1041  REAL(KIND=8) :: ray
1042  INTEGER :: m, l , i, mode, index, k, n
1043  INTEGER :: m_max_pad, bloc_size
1044  mpi_comm :: communicator
1045 
1046  CALL gauss(mesh)
1047 
1048  tensor_surface_gauss = 0.d0
1049  DO n = 1, inputs%nb_fluid-1
1050  DO i = 1, SIZE(list_mode)
1051  mode = list_mode(i)
1052  index = 0
1053  DO m = 1, mesh%dom_me
1054  j_loc = mesh%jj(:,m)
1055  DO k = 1, 2
1056  level_set_loc(:,k) = level_set(n,j_loc,k,i)
1057  END DO
1058  DO l = 1, l_g
1059  index = index + 1
1060  dw_loc = dw(:,:,l,m)
1061 
1062  !===Compute radius of Gauss point
1063  ray = sum(mesh%rr(1,j_loc)*ww(:,l))
1064 
1065  !-----------------Grad u_r on Gauss points------------------------------------
1066  grad_level(index,1,i) = sum(level_set_loc(:,1)*dw_loc(1,:))
1067  grad_level(index,2,i) = sum(level_set_loc(:,2)*dw_loc(1,:))
1068  grad_level(index,3,i) = mode/ray*sum(level_set_loc(:,2)*ww(:,l))
1069  grad_level(index,4,i) = -mode/ray*sum(level_set_loc(:,1)*ww(:,l))
1070  grad_level(index,5,i) = sum(level_set_loc(:,1)*dw_loc(2,:))
1071  grad_level(index,6,i) = sum(level_set_loc(:,2)*dw_loc(2,:))
1072  END DO
1073  ENDDO
1074  ENDDO
1075  m_max_pad = 3*SIZE(list_mode)*nb_procs/2
1076  bloc_size = SIZE(grad_level,1)/nb_procs+1
1077  CALL fft_tensor_dcl(communicator, grad_level, grad_level, tensor, nb_procs, bloc_size, m_max_pad, opt_tension=.true.)
1078  tensor_surface_gauss = tensor_surface_gauss + inputs%coeff_surface(n)*tensor
1079  END DO
1080 
1081  END SUBROUTINE smb_surface_tension
1082 
1083  SUBROUTINE momentum_dirichlet(communicator, mesh, list_mode, t, nb_procs, density, momentum_exact, vv_js_D)
1085  USE sft_parallele
1086  USE chaine_caractere
1087  USE boundary
1088  USE input_data
1089  IMPLICIT NONE
1090  TYPE(mesh_type), TARGET :: mesh
1091  INTEGER, INTENT(IN) :: nb_procs
1092  REAL(KIND=8), INTENT(IN) :: t
1093  INTEGER, DIMENSION(:), INTENT(IN) :: list_mode
1094  REAL(KIND=8), DIMENSION(:,:,:), INTENT(IN) :: density
1095  TYPE(dyn_int_line), DIMENSION(3),INTENT(IN) :: vv_js_D
1096  REAL(KIND=8), DIMENSION(mesh%np,6,SIZE(list_mode)), INTENT(OUT) :: momentum_exact
1097  REAL(KIND=8), DIMENSION(SIZE(vv_js_D(1)%DIL),2,SIZE(list_mode)) :: vel_exact_r, mr
1098  REAL(KIND=8), DIMENSION(SIZE(vv_js_D(2)%DIL),2,SIZE(list_mode)) :: vel_exact_t, mt
1099  REAL(KIND=8), DIMENSION(SIZE(vv_js_D(3)%DIL),2,SIZE(list_mode)) :: vel_exact_z, mz
1100  INTEGER :: i, k, kk
1101  INTEGER :: m_max_pad, bloc_size
1102  mpi_comm :: communicator
1103 
1104  IF (inputs%if_level_set) THEN
1105  DO i = 1, SIZE(list_mode)
1106  DO k = 1, 2
1107  vel_exact_r(:,k,i) = vv_exact(k, mesh%rr(:,vv_js_d(1)%DIL),list_mode(i),t)
1108  vel_exact_t(:,k,i) = vv_exact(k+2,mesh%rr(:,vv_js_d(2)%DIL),list_mode(i),t)
1109  vel_exact_z(:,k,i) = vv_exact(k+4,mesh%rr(:,vv_js_d(3)%DIL),list_mode(i),t)
1110  END DO
1111  END DO
1112 
1113  m_max_pad = 3*SIZE(list_mode)*nb_procs/2
1114  bloc_size = SIZE(vv_js_d(1)%DIL)/nb_procs+1
1115  CALL fft_par_prod_dcl(communicator, density(vv_js_d(1)%DIL,:,:), vel_exact_r, &
1116  mr, nb_procs, bloc_size, m_max_pad)
1117  momentum_exact(vv_js_d(1)%DIL,1:2,:) = mr
1118 
1119  bloc_size = SIZE(vv_js_d(2)%DIL)/nb_procs+1
1120  CALL fft_par_prod_dcl(communicator, density(vv_js_d(2)%DIL,:,:), vel_exact_t, &
1121  mt, nb_procs, bloc_size, m_max_pad)
1122  momentum_exact(vv_js_d(2)%DIL,3:4,:) = mt
1123 
1124  bloc_size = SIZE(vv_js_d(3)%DIL)/nb_procs+1
1125  CALL fft_par_prod_dcl(communicator, density(vv_js_d(3)%DIL,:,:), vel_exact_z, &
1126  mz, nb_procs, bloc_size, m_max_pad)
1127  momentum_exact(vv_js_d(3)%DIL,5:6,:) = mz
1128  ELSE
1129  DO i = 1, SIZE(list_mode)
1130  DO k = 1, 6
1131  kk = (k-1)/2 + 1
1132  momentum_exact(vv_js_d(kk)%DIL,k,i) = vv_exact(k,mesh%rr(:,vv_js_d(kk)%DIL),list_mode(i),t)
1133  END DO
1134  END DO
1135  END IF
1136 
1137  END SUBROUTINE momentum_dirichlet
1138 
1139  SUBROUTINE twod_volume(communicator,mesh,RESLT)
1140  !===========================
1141  USE def_type_mesh
1142  IMPLICIT NONE
1143  TYPE(mesh_type) :: mesh
1144  REAL(KIND=8), INTENT(OUT) :: RESLT
1145  REAL(KIND=8) :: vol_loc, vol_out
1146  INTEGER, DIMENSION(mesh%gauss%n_w) :: j_loc
1147  INTEGER :: m, l , i , ni, code
1148  REAL(KIND=8) :: ray
1149  mpi_comm :: communicator
1150  vol_loc = 0.d0
1151  DO m = 1, mesh%dom_me
1152  j_loc = mesh%jj(:,m)
1153  DO l = 1, mesh%gauss%l_G
1154  ray = 0
1155  DO ni = 1, mesh%gauss%n_w; i = j_loc(ni)
1156  ray = ray + mesh%rr(1,i)*mesh%gauss%ww(ni,l)
1157  END DO
1158  vol_loc = vol_loc + ray*mesh%gauss%rj(l,m)
1159  ENDDO
1160  ENDDO
1161  CALL mpi_allreduce(vol_loc,vol_out,1,mpi_double_precision, mpi_sum, communicator, code)
1162  reslt = vol_out
1163  END SUBROUTINE twod_volume
1164 
1165  SUBROUTINE moy(communicator,mesh,p,RESLT)
1166  !===========================
1167  !===average of p
1168  USE def_type_mesh
1169  IMPLICIT NONE
1170  TYPE(mesh_type) :: mesh
1171  REAL(KIND=8), DIMENSION(:) , INTENT(IN) :: p
1172  REAL(KIND=8) , INTENT(OUT) :: RESLT
1173  REAL(KIND=8) :: vol_loc, vol_out, r_loc, r_out
1174  INTEGER :: m, l , i , ni, code
1175  INTEGER, DIMENSION(mesh%gauss%n_w) :: j_loc
1176  REAL(KIND=8) :: ray
1177  mpi_comm :: communicator
1178  r_loc = 0.d0
1179  vol_loc = 0.d0
1180 
1181  DO m = 1, mesh%dom_me
1182  j_loc = mesh%jj(:,m)
1183  DO l = 1, mesh%gauss%l_G
1184  ray = 0
1185  DO ni = 1, mesh%gauss%n_w; i = j_loc(ni)
1186  ray = ray + mesh%rr(1,i)*mesh%gauss%ww(ni,l)
1187  END DO
1188 
1189  r_loc = r_loc + sum(p(j_loc(:))*mesh%gauss%ww(:,l))*ray*mesh%gauss%rj(l,m)
1190  vol_loc = vol_loc + ray*mesh%gauss%rj(l,m)
1191 
1192  ENDDO
1193  ENDDO
1194 
1195  CALL mpi_allreduce(r_loc,r_out,1,mpi_double_precision, mpi_sum, communicator, code)
1196  CALL mpi_allreduce(vol_loc,vol_out,1,mpi_double_precision, mpi_sum, communicator, code)
1197  reslt = r_out / vol_out
1198 
1199  END SUBROUTINE moy
1200 
1201 END MODULE subroutine_ns_with_m
subroutine solver(my_ksp, b, x, reinit, verbose)
Definition: solver.f90:99
subroutine qs_ns_momentum_stab_3x3(mesh, vv_3_LA, mode, ff, V1m, P, vb_3_145, vb_3_236, rotb_b, tensor, tensor_surface_gauss, stab, momentum, visc_grad_vel)
subroutine, public extract(xghost, ks, ke, LA, phi)
Definition: st_csr.f90:34
integer, public l_g
subroutine, public create_my_ghost(mesh, LA, ifrom)
Definition: st_csr.f90:15
subroutine, public smb_surface_tension(communicator, mesh, list_mode, nb_procs, level_set, tensor_surface_gauss)
subroutine, public fft_tensor_dcl(communicator, V1_in, V2_in, V_out, nb_procs, bloc_size, m_max_pad, temps, opt_tension)
subroutine qs_01_div_hybrid_2006(vv_mesh, pp_mesh, pp_LA, mode, gg, pb_1, pb_2)
subroutine twod_volume(communicator, mesh, RESLT)
subroutine, public fft_compute_entropy_visc_grad_mom(communicator, V1_in, V2_in, V3_in, c_in_real, V_out, nb_procs, bloc_size, m_max_pad, temps)
subroutine, public compute_entropy_viscosity_mom(comm_one_d, vv_3_LA, vv_mesh, pp_mesh, time, list_mode, momentum, momentum_m1, momentum_m2, pn_m1, un_m1, tensor_m1, visc_grad_vel_m1, tensor_surface_gauss, rotb_b_m1, visco_dyn_m1, density_m2, density_m1, density, tempn, visc_entro_real, visc_entro_level_real)
subroutine create_local_petsc_matrix(communicator, LA, matrix, clean)
Definition: solver.f90:147
subroutine error_petsc(string)
Definition: my_util.f90:16
type(my_data), public inputs
real(kind=8) function user_time()
Definition: my_util.f90:8
subroutine, public fft_par_cross_prod_dcl(communicator, V1_in, V2_in, V_out, nb_procs, bloc_size, m_max_pad, temps)
subroutine, public smb_explicit_diffu_sym(communicator, mesh, list_mode, nb_procs, visc_dyn, vel, V_out)
subroutine qs_diff_mass_scal_m(mesh, LA, visco, mass, stab, mode, matrix)
Definition: fem_M_axi.f90:130
subroutine, public fft_compute_diffu_mom(communicator, V1_in, V2_in, V3_in, V1_out, V2_out, nb_procs, bloc_size, m_max_pad, temps)
subroutine, public fft_par_prod_dcl(communicator, c1_in, c2_in, c_out, nb_procs, bloc_size, m_max_pad, temps)
subroutine, public three_level_ns_tensor_sym_with_m(comm_one_d, time, vv_3_LA, pp_1_LA, dt, Re, list_mode, pp_mesh, vv_mesh, incpn_m1, incpn, pn_m1, pn, un_m1, un, Hn_p2, Bn_p2, density_m1, density, density_p1, visco_dyn, tempn, level_set, level_set_p1, visc_entro_level)
real(kind=8) function norm_s(communicator, norm_type, mesh, list_mode, v)
Definition: tn_axi.f90:88
subroutine init_solver(my_par, my_ksp, matrix, communicator, solver, precond, opt_re_init)
Definition: solver.f90:12
subroutine dirichlet_rhs(js_D, bs_D, b)
subroutine vector_glob_js_d(vv_mesh, list_mode, vv_3_LA, vv_list_dirichlet_sides, vv_js_D, vv_mode_global_js_D)
subroutine, public compute_entropy_viscosity_mom_no_level_set(comm_one_d, vv_3_LA, vv_mesh, pp_mesh, time, list_mode, momentum, momentum_m1, momentum_m2, pn_m1, un_m1, tensor_m1, rotb_b_m1, tempn, visc_entro_real)
subroutine inject(jj_c, jj_f, pp_c, pp_f)
Definition: tn_axi.f90:5
subroutine, public momentum_dirichlet(communicator, mesh, list_mode, t, nb_procs, density, momentum_exact, vv_js_D)
subroutine dirichlet_m_parallel(matrix, glob_js_D)
type(my_verbose), public talk_to_me
Definition: verbose.f90:27
real(kind=8) function norm_sf(communicator, norm_type, mesh, list_mode, v)
Definition: tn_axi.f90:40
subroutine, public fft_scalar_vect_dcl(communicator, V1_in, V2_in, V_out, pb, nb_procs, bloc_size, m_max_pad, temps)
subroutine qs_diff_mass_vect_3x3(type_op, LA, mesh, visco, mass, stab, stab_bdy_ns, i_mode, mode, matrix)
Definition: fem_M_axi.f90:399
subroutine twod_volume(communicator, mesh, RESLT)
subroutine, public smb_explicit_les(communicator, mesh, list_mode, nb_procs, visc_entro_real, mom, V_out)
subroutine, public inject_p1_p2(jj_c, jj_f, pp_c, pp_f)
Definition: sub_mass.f90:270
subroutine gauss(mesh)
subroutine moy(communicator, mesh, p, RESLT)
real(kind=8), dimension(:,:,:,:), pointer dw
real(kind=8), dimension(:,:), pointer ww
subroutine smb_curlh_cross_b_gauss_sft_par(communicator, mesh, list_mode, V_in, W_in, V_out)
subroutine scalar_without_glob_js_d(pp_mesh, list_mode, pp_1_LA, pp_mode_global_js_D)