SFEMaNS  version 4.1 (work in progress)
Reference documentation for SFEMaNS
 All Classes Files Functions Variables Groups Pages
condlim_test_21.f90
Go to the documentation of this file.
2  USE my_util
3  USE def_type_mesh
4  USE input_data
5 !!$ATTENTION
6 !!$Some subroutines have been commented to avoid warning messages when compiling executable.
7 !!$It can not be done in the module boundary_generic that expects all subroutines to be present.
8 !!$END ATTENTION
9  PUBLIC :: init_velocity_pressure
10 !!$ PUBLIC :: init_temperature
11  PUBLIC :: init_level_set
12  PUBLIC :: source_in_ns_momentum
13 !!$ PUBLIC :: source_in_temperature
14  PUBLIC :: source_in_level_set
15  PUBLIC :: vv_exact
16 !!$ PUBLIC :: imposed_velocity_by_penalty
17  PUBLIC :: pp_exact
18 !!$ PUBLIC :: temperature_exact
19  PUBLIC :: level_set_exact
20 !!$ PUBLIC :: penal_in_real_space
21  PUBLIC :: extension_velocity
22 !!$ PUBLIC :: Vexact
23 !!$ PUBLIC :: H_B_quasi_static
24  PUBLIC :: hexact
25  PUBLIC :: phiexact
26  PUBLIC :: jexact_gauss
27  PUBLIC :: eexact_gauss
28  PUBLIC :: init_maxwell
29 !!$ PUBLIC :: mu_bar_in_fourier_space
30 !!$ PUBLIC :: grad_mu_bar_in_fourier_space
31 !!$ PUBLIC :: mu_in_real_space
33  PRIVATE
34 
35 CONTAINS
36  !===============================================================================
37  ! Boundary conditions for Navier-Stokes
38  !===============================================================================
39 
40  !===Initialize velocity, pressure
41  SUBROUTINE init_velocity_pressure(mesh_f, mesh_c, time, dt, list_mode, &
42  un_m1, un, pn_m1, pn, phin_m1, phin)
43  IMPLICIT NONE
44  TYPE(mesh_type) :: mesh_f, mesh_c
45  REAL(KIND=8), INTENT(OUT):: time
46  REAL(KIND=8), INTENT(IN) :: dt
47  INTEGER, DIMENSION(:), INTENT(IN) :: list_mode
48  REAL(KIND=8), DIMENSION(:,:,:), INTENT(OUT):: un_m1, un
49  REAL(KIND=8), DIMENSION(:,:,:), INTENT(OUT):: pn_m1, pn, phin_m1, phin
50  INTEGER :: mode, i, j
51  REAL(KIND=8), DIMENSION(mesh_c%np) :: pn_m2
52 
53  time = 0.d0
54  DO i= 1, SIZE(list_mode)
55  mode = list_mode(i)
56  DO j = 1, 6
57  !===velocity
58  un_m1(:,j,i) = vv_exact(j,mesh_f%rr,mode,time-dt)
59  un(:,j,i) = vv_exact(j,mesh_f%rr,mode,time)
60  END DO
61  DO j = 1, 2
62  !===pressure
63  pn_m2(:) = pp_exact(j,mesh_c%rr,mode,time-2*dt)
64  pn_m1(:,j,i) = pp_exact(j,mesh_c%rr,mode,time-dt)
65  pn(:,j,i) = pp_exact(j,mesh_c%rr,mode,time)
66  phin_m1(:,j,i) = pn_m1(:,j,i) - pn_m2(:)
67  phin(:,j,i) = pn(:,j,i) - pn_m1(:,j,i)
68  ENDDO
69  ENDDO
70  END SUBROUTINE init_velocity_pressure
71 
72 !!$ !===Initialize temperature
73 !!$ SUBROUTINE init_temperature(mesh, time, dt, list_mode, tempn_m1, tempn)
74 !!$ IMPLICIT NONE
75 !!$ TYPE(mesh_type) :: mesh
76 !!$ REAL(KIND=8), INTENT(OUT):: time
77 !!$ REAL(KIND=8), INTENT(IN) :: dt
78 !!$ INTEGER, DIMENSION(:), INTENT(IN) :: list_mode
79 !!$ REAL(KIND=8), DIMENSION(:,:,:), INTENT(OUT):: tempn_m1, tempn
80 !!$ INTEGER :: mode, i, j
81 !!$
82 !!$ time = 0.d0
83 !!$ DO i= 1, SIZE(list_mode)
84 !!$ mode = list_mode(i)
85 !!$ DO j = 1, 2
86 !!$ tempn_m1(:,j,i) = temperature_exact(j, mesh%rr, mode, time-dt)
87 !!$ tempn (:,j,i) = temperature_exact(j, mesh%rr, mode, time)
88 !!$ ENDDO
89 !!$ ENDDO
90 !!$ END SUBROUTINE init_temperature
91 
92  !===Initialize level_set
93  SUBROUTINE init_level_set(vv_mesh, time, &
94  dt, list_mode, level_set_m1, level_set)
95  IMPLICIT NONE
96  TYPE(mesh_type) :: vv_mesh
97  REAL(KIND=8), INTENT(OUT):: time
98  REAL(KIND=8), INTENT(IN) :: dt
99  INTEGER, DIMENSION(:), INTENT(IN) :: list_mode
100  REAL(KIND=8), DIMENSION(:,:,:,:), INTENT(OUT):: level_set, level_set_m1
101  INTEGER :: mode, i, j, n
102 
103  time = 0.d0
104  DO i= 1, SIZE(list_mode)
105  mode = list_mode(i)
106  DO j = 1, 2
107  !===level_set
108  DO n = 1, inputs%nb_fluid -1
109  level_set_m1(n,:,j,i) = level_set_exact(n,j,vv_mesh%rr,mode,time-dt)
110  level_set(n,:,j,i) = level_set_exact(n,j,vv_mesh%rr,mode,time)
111  END DO
112  END DO
113  END DO
114 
115  END SUBROUTINE init_level_set
116 
117  !===Source in momemtum equation. Always called.
118  FUNCTION source_in_ns_momentum(TYPE, rr, mode, i, time, Re, ty, opt_density, opt_tempn) RESULT(vv)
119  IMPLICIT NONE
120  INTEGER , INTENT(IN) :: type
121  REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
122  INTEGER , INTENT(IN) :: mode, i
123  REAL(KIND=8), INTENT(IN) :: time
124  REAL(KIND=8), INTENT(IN) :: re
125  CHARACTER(LEN=2), INTENT(IN) :: ty
126  REAL(KIND=8), DIMENSION(:,:,:), OPTIONAL, INTENT(IN) :: opt_density
127  REAL(KIND=8), DIMENSION(:,:,:), OPTIONAL, INTENT(IN) :: opt_tempn
128  REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
129  REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: r, z
130  INTEGER :: m
131  CHARACTER(LEN=2) :: np
132 
133  IF (present(opt_tempn)) CALL error_petsc('temperature should not be present for test 21')
134 
135  r = rr(1,:)
136  z = rr(2,:)
137  m = mode
138 
139  IF (m==0 .AND. type==1) THEN
140  vv = 32.d0*r**3*z**2
141  ELSE IF (m==0 .AND. type==5) THEN
142  vv = 8.d0*r**4*z
143  ELSE
144  vv = 0.d0
145  END IF
146  RETURN
147 
148  !===Dummies variables to avoid warning
149  m=i; r=time; r=re; np=ty
150  IF (present(opt_density)) m=SIZE(opt_density,1)
151  !===Dummies variables to avoid warning
152  END FUNCTION source_in_ns_momentum
153 
154 !!$ !===Extra source in temperature equation. Always called.
155 !!$ FUNCTION source_in_temperature(TYPE, rr, m, t)RESULT(vv)
156 !!$ IMPLICIT NONE
157 !!$ INTEGER , INTENT(IN) :: TYPE
158 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
159 !!$ INTEGER , INTENT(IN) :: m
160 !!$ REAL(KIND=8), INTENT(IN) :: t
161 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
162 !!$
163 !!$ vv = 0.d0
164 !!$ CALL error_petsc('source_in_temperature: should not be called for this test')
165 !!$ RETURN
166 !!$ END FUNCTION source_in_temperature
167 
168  !===Extra source in level set equation. Always called.
169  FUNCTION source_in_level_set(interface_nb,TYPE, rr, m, t)RESULT(vv)
170  IMPLICIT NONE
171  INTEGER , INTENT(IN) :: type
172  REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
173  INTEGER , INTENT(IN) :: m, interface_nb
174  REAL(KIND=8), INTENT(IN) :: t
175  REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
176  REAL(KIND=8) :: r
177  INTEGER :: n
178 
179  vv = 0.d0
180  RETURN
181 
182  !===Dummies variables to avoid warning
183  n=type; n=SIZE(rr,1); n=m; n=interface_nb; r=t
184  !===Dummies variables to avoid warning
185  END FUNCTION source_in_level_set
186 
187  !===Velocity for boundary conditions in Navier-Stokes.
188  !===Can be used also to initialize velocity in: init_velocity_pressure_temperature
189  FUNCTION vv_exact(TYPE,rr,m,t) RESULT(vv)
190  IMPLICIT NONE
191  INTEGER , INTENT(IN) :: type
192  REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
193  INTEGER, INTENT(IN) :: m
194  REAL(KIND=8), INTENT(IN) :: t
195  REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
196  REAL(KIND=8) :: r
197  INTEGER :: n
198 
199  vv = 0.d0
200  RETURN
201 
202  !===Dummies variables to avoid warning
203  n=type; n=SIZE(rr,1); n=m; r=t
204  !===Dummies variables to avoid warning
205  END FUNCTION vv_exact
206 
207 !!$ !===Solid velocity imposed when using penalty technique
208 !!$ !===Defined in Fourier space on mode 0 only.
209 !!$ FUNCTION imposed_velocity_by_penalty(rr,t) RESULT(vv)
210 !!$ IMPLICIT NONE
211 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
212 !!$ REAL(KIND=8), INTENT(IN) :: t
213 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2),6) :: vv
214 !!$
215 !!$ vv=0.d0
216 !!$ RETURN
217 !!$ END FUNCTION imposed_velocity_by_penalty
218 
219  !===Pressure for boundary conditions in Navier-Stokes.
220  !===Can be used also to initialize pressure in the subroutine init_velocity_pressure.
221  !===Use this routine for outflow BCs only.
222  !===CAUTION: Do not enfore BCs on pressure where normal component
223  ! of velocity is prescribed.
224  FUNCTION pp_exact(TYPE,rr,m,t) RESULT (vv)
225  IMPLICIT NONE
226  INTEGER , INTENT(IN) :: type
227  REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
228  INTEGER , INTENT(IN) :: m
229  REAL(KIND=8), INTENT(IN) :: t
230  REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
231  REAL(KIND=8) :: r
232  INTEGER :: n
233 
234  vv = 0.d0
235  RETURN
236 
237  !===Dummies variables to avoid warning
238  n=type; n=SIZE(rr,1); n=m; r=t
239  !===Dummies variables to avoid warning
240  END FUNCTION pp_exact
241 
242 !!$ !===Temperature for boundary conditions in temperature equation.
243 !!$ FUNCTION temperature_exact(TYPE,rr,m,t) RESULT (vv)
244 !!$ IMPLICIT NONE
245 !!$ INTEGER , INTENT(IN) :: TYPE
246 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
247 !!$ INTEGER , INTENT(IN) :: m
248 !!$ REAL(KIND=8), INTENT(IN) :: t
249 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
250 !!$
251 !!$ vv = 0.d0
252 !!$ CALL error_petsc('temperature_exact: should not be called for this test')
253 !!$ RETURN
254 !!$ END FUNCTION temperature_exact
255 
256  !===Can be used to initialize level set in the subroutine init_level_set.
257  FUNCTION level_set_exact(interface_nb,TYPE,rr,m,t) RESULT (vv)
258  IMPLICIT NONE
259  INTEGER , INTENT(IN) :: type
260  REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
261  INTEGER , INTENT(IN) :: m, interface_nb
262  REAL(KIND=8), INTENT(IN) :: t
263  REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
264  REAL(KIND=8) :: r
265 
266  IF (interface_nb==1) THEN
267  IF (m==0 .AND. TYPE ==1) then
268  vv = 1.d0 + rr(2,:)
269  ELSE IF (m==1 .AND. type==1) THEN
270  vv = rr(1,:)
271  ELSE
272  vv = 0.d0
273  END IF
274  ELSE
275  CALL error_petsc(' BUG in level_set_exact, we should compute only 1 level set')
276  END IF
277  RETURN
278 
279  !===Dummies variables to avoid warning
280  r=t
281  !===Dummies variables to avoid warning
282  END FUNCTION level_set_exact
283 
284 !!$ !===Penalty coefficient (if needed)
285 !!$ !===This coefficient is equal to zero in subdomain
286 !!$ !===where penalty is applied (penalty is zero in solid)
287 !!$ FUNCTION penal_in_real_space(mesh,rr_gauss,angles,nb_angles,nb,ne,time) RESULT(vv)
288 !!$ IMPLICIT NONE
289 !!$ TYPE(mesh_type) :: mesh
290 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr_gauss
291 !!$ REAL(KIND=8), DIMENSION(:), INTENT(IN) :: angles
292 !!$ INTEGER, INTENT(IN) :: nb_angles
293 !!$ INTEGER, INTENT(IN) :: nb, ne
294 !!$ REAL(KIND=8), INTENT(IN) :: time
295 !!$ REAL(KIND=8), DIMENSION(nb_angles,ne-nb+1) :: vv
296 !!$
297 !!$ vv = 1.d0
298 !!$ CALL error_petsc('penal_in_real_space: should not be called for this test')
299 !!$ RETURN
300 !!$ END FUNCTION penal_in_real_space
301 
302  !===Extension of the velocity field in the solid.
303  !===Used when temperature or Maxwell equations are solved.
304  !===It extends the velocity field on the Navier-Stokes domain to a
305  !===velocity field on the temperature and the Maxwell domain.
306  !===It is also used if problem type=mxw and restart velocity
307  !===is set to true in data (type problem denoted mxx in the code).
308  FUNCTION extension_velocity(TYPE, H_mesh, mode, t, n_start) RESULT(vv)
309  IMPLICIT NONE
310  TYPE(mesh_type), INTENT(IN) :: h_mesh
311  INTEGER , INTENT(IN) :: type, n_start
312  INTEGER, INTENT(IN) :: mode
313  REAL(KIND=8), INTENT(IN) :: t
314  REAL(KIND=8), DIMENSION(H_Mesh%np) :: vv
315  REAL(KIND=8) :: r
316  INTEGER :: n
317 
318  vv = 0.d0
319  RETURN
320 
321  !===Dummies variables to avoid warning
322  n=h_mesh%np; r=t; n=type; n=mode; n=n_start
323  !===Dummies variables to avoid warning
324  END FUNCTION extension_velocity
325 
326  !===============================================================================
327  ! Boundary conditions for Maxwell
328  !===============================================================================
329 !!$ !===Velocity used in the induction equation.
330 !!$ !===Used only if problem type is mxw and restart velocity is false
331 !!$ FUNCTION Vexact(m, H_mesh) RESULT(vv) !Set uniquement a l'induction
332 !!$ IMPLICIT NONE
333 !!$ TYPE(mesh_type), INTENT(IN) :: H_mesh
334 !!$ INTEGER, INTENT(IN) :: m
335 !!$ REAL(KIND=8), DIMENSION(H_mesh%np,6) :: vv
336 !!$
337 !!$ vv = 0.d0
338 !!$ END FUNCTION Vexact
339 
340 !!$ !===Magnetic field and magnetic induction for quasi-static approximation
341 !!$ !===if needed
342 !!$ FUNCTION H_B_quasi_static(char_h_b, rr, m) RESULT(vv)
343 !!$ IMPLICIT NONE
344 !!$ CHARACTER(LEN=1), INTENT(IN) :: char_h_b
345 !!$ REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
346 !!$ INTEGER, INTENT(IN) :: m
347 !!$ REAL(KIND=8), DIMENSION(SIZE(rr,2),6) :: vv
348 !!$
349 !!$ vv = 0.d0
350 !!$ RETURN
351 !!$ END FUNCTION H_B_quasi_static
352 
353  !===Magnetic field for boundary conditions in the Maxwell equations.
354  FUNCTION hexact(H_mesh,TYPE, rr, m, mu_H_field, t) RESULT(vv)
355  IMPLICIT NONE
356  TYPE(mesh_type), INTENT(IN) :: h_mesh
357  INTEGER , INTENT(IN) :: type
358  REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
359  INTEGER , INTENT(IN) :: m
360  REAL(KIND=8), INTENT(IN) :: t
361  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: mu_h_field
362  REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
363  REAL(KIND=8) :: r
364  INTEGER :: n
365 
366  IF (m==0.AND. type==1) THEN
367  vv = rr(1,:)**3
368  ELSE IF (m==0.AND.type==5) THEN
369  vv = -4.d0*rr(1,:)**2*rr(2,:)
370  ELSE
371  vv = 0.d0
372  END IF
373  RETURN
374 
375  !===Dummies variables to avoid warning
376  n=h_mesh%np; r=mu_h_field(1); r=t
377  !===Dummies variables to avoid warning
378  END FUNCTION hexact
379 
380  !===Scalar potential for boundary conditions in the Maxwell equations.
381  FUNCTION phiexact(TYPE, rr, m, mu_phi,t) RESULT(vv)
382  IMPLICIT NONE
383  INTEGER , INTENT(IN) :: type
384  REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: rr
385  INTEGER , INTENT(IN) :: m
386  REAL(KIND=8), INTENT(IN) :: mu_phi, t
387  REAL(KIND=8), DIMENSION(SIZE(rr,2)) :: vv
388  REAL(KIND=8) :: r
389  INTEGER :: n
390 
391  vv=0.d0
392  CALL error_petsc('Phiexact: should not be called for this test')
393  RETURN
394 
395  !===Dummies variables to avoid warning
396  n=type; n=SIZE(rr,1); n=m; r=mu_phi; r=t
397  !===Dummies variables to avoid warning
398  END FUNCTION phiexact
399 
400  !===Current in Ohm's law. Curl(H) = sigma(E + uxB) + current
401  FUNCTION jexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t, mesh_id, opt_B_ext) RESULT(vv)
402  IMPLICIT NONE
403  INTEGER , INTENT(IN) :: type
404  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: rr
405  INTEGER , INTENT(IN) :: m
406  REAL(KIND=8), INTENT(IN) :: mu_phi, sigma, mu_h, t
407  INTEGER , INTENT(IN) :: mesh_id
408  REAL(KIND=8), DIMENSION(6), OPTIONAL,INTENT(IN) :: opt_b_ext
409  REAL(KIND=8) :: vv
410  REAL(KIND=8) :: r
411  INTEGER :: n
412 
413  IF(m==0.AND.type==3) THEN
414  vv = 8.d0*rr(1)*rr(2)
415  ELSE
416  vv = 0.d0
417  END IF
418  RETURN
419 
420  !===Dummies variables to avoid warning
421  r=rr(1); r=mu_phi; r=sigma; r=mu_h; r=t; n=type; n=m; n=mesh_id
422  IF (present(opt_b_ext)) r=opt_b_ext(1)
423  !===Dummies variables to avoid warning
424  END FUNCTION jexact_gauss
425 
426  !===Electric field for Neumann BC (cf. doc)
427  FUNCTION eexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t) RESULT(vv)
428  IMPLICIT NONE
429  INTEGER, INTENT(IN) :: type
430  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: rr
431  INTEGER, INTENT(IN) :: m
432  REAL(KIND=8), INTENT(IN) :: mu_phi, sigma, mu_h, t
433  REAL(KIND=8) :: vv
434  REAL(KIND=8) :: r
435  INTEGER :: n
436 
437  vv = 0.d0
438  RETURN
439 
440  !===Dummies variables to avoid warning
441  r=rr(1); r=mu_phi; r=sigma; r=mu_h; r=t; n=type; n=m
442  !===Dummies variables to avoid warning
443  END FUNCTION eexact_gauss
444 
445  !===Initialization of magnetic field and scalar potential (if present)
446  SUBROUTINE init_maxwell(H_mesh, phi_mesh, time, dt, mu_H_field, mu_phi, &
447  list_mode, hn1, hn, phin1, phin)
448  IMPLICIT NONE
449  TYPE(mesh_type) :: h_mesh, phi_mesh
450  REAL(KIND=8), INTENT(OUT):: time
451  REAL(KIND=8), INTENT(IN) :: dt
452  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: mu_h_field
453  REAL(KIND=8), INTENT(IN) :: mu_phi
454  INTEGER, DIMENSION(:), INTENT(IN) :: list_mode
455  REAL(KIND=8), DIMENSION(:,:,:), INTENT(OUT):: hn, hn1
456  REAL(KIND=8), DIMENSION(:,:,:), INTENT(OUT):: phin, phin1
457  INTEGER :: i, k
458 
459  time = -dt
460  DO k=1,6
461  DO i=1, SIZE(list_mode)
462  hn1(:,k,i) = hexact(h_mesh,k, h_mesh%rr, list_mode(i), mu_h_field, time)
463  IF (inputs%nb_dom_phi>0) THEN
464  IF (k<3) THEN
465  phin1(:,k,i) = phiexact(k, phi_mesh%rr, list_mode(i) , mu_phi, time)
466  ENDIF
467  END IF
468  ENDDO
469  ENDDO
470 
471  time = time + dt
472  DO k=1,6
473  DO i=1, SIZE(list_mode)
474  hn(:,k,i) = hexact(h_mesh,k, h_mesh%rr, list_mode(i), mu_h_field, time)
475  IF (inputs%nb_dom_phi>0) THEN
476  IF (k<3) THEN
477  phin(:,k,i) = phiexact(k, phi_mesh%rr, list_mode(i), mu_phi, time)
478  ENDIF
479  END IF
480  ENDDO
481  ENDDO
482  END SUBROUTINE init_maxwell
483 
484 !!$ !===Analytical permeability (if needed)
485 !!$ !===This function is not needed unless the flag
486 !!$ !=== ===Use FEM Interpolation for magnetic permeability (true/false)
487 !!$ !===is activated and set to .FALSE. in the data data file. Default is .TRUE.
488 !!$ FUNCTION mu_bar_in_fourier_space(H_mesh,nb,ne,pts,pts_ids) RESULT(vv)
489 !!$ IMPLICIT NONE
490 !!$ TYPE(mesh_type), INTENT(IN) :: H_mesh
491 !!$ REAL(KIND=8), DIMENSION(ne-nb+1) :: vv
492 !!$ INTEGER, INTENT(IN) :: nb, ne
493 !!$ REAL(KIND=8),DIMENSION(2,ne-nb+1),OPTIONAL :: pts
494 !!$ INTEGER, DIMENSION(ne-nb+1), OPTIONAL :: pts_ids
495 !!$
496 !!$ vv = 1.d0
497 !!$ CALL error_petsc('mu_bar_in_fourier_space: should not be called for this test')
498 !!$ RETURN
499 !!$ END FUNCTION mu_bar_in_fourier_space
500 
501 !!$ !===Analytical mu_in_fourier_space (if needed)
502 !!$ !===This function is not needed unless the flag
503 !!$ !=== ===Use FEM Interpolation for magnetic permeability (true/false)
504 !!$ !===is activated and set to .FALSE. in the data data file. Default is .TRUE.
505 !!$ FUNCTION grad_mu_bar_in_fourier_space(pt,pt_id) RESULT(vv)
506 !!$ IMPLICIT NONE
507 !!$ REAL(KIND=8),DIMENSION(2), INTENT(in):: pt
508 !!$ INTEGER,DIMENSION(1), INTENT(in) :: pt_id
509 !!$ REAL(KIND=8),DIMENSION(2) :: vv
510 !!$
511 !!$ vv=0.d0
512 !!$ CALL error_petsc('grad_mu_bar_in_fourier_space: should not be called for this test')
513 !!$ RETURN
514 !!$ END FUNCTION grad_mu_bar_in_fourier_space
515 
516 !!$ !===Analytical permeability, mu in real space (if needed)
517 !!$ FUNCTION mu_in_real_space(H_mesh,angles,nb_angles,nb,ne,time) RESULT(vv)
518 !!$ IMPLICIT NONE
519 !!$ TYPE(mesh_type), INTENT(IN) :: H_mesh
520 !!$ REAL(KIND=8), DIMENSION(:), INTENT(IN) :: angles
521 !!$ INTEGER, INTENT(IN) :: nb_angles
522 !!$ INTEGER, INTENT(IN) :: nb, ne
523 !!$ REAL(KIND=8), INTENT(IN) :: time
524 !!$ REAL(KIND=8), DIMENSION(nb_angles,ne-nb+1) :: vv
525 !!$
526 !!$ vv = 1.d0
527 !!$ CALL error_petsc('mu_in_real_space: should not be called for this test')
528 !!$ RETURN
529 !!$ END FUNCTION mu_in_real_space
530 
531  !=== Only used for multiphase flow with variable electrical conductivity
532  !===This function is not needed unless the following line is in the data
533  !=== ===Conductivity of fluid 0, fluid 1, ...
534  !=== The above line should be followed by the value of the conductivity in the different fluids.
535  !=== The result vv has to smaller than the effective conductivity on every nodes of the mesh.
536  FUNCTION sigma_bar_in_fourier_space(H_mesh) RESULT(vv)
537  USE input_data
538  IMPLICIT NONE
539  TYPE(mesh_type), INTENT(IN) :: h_mesh
540  REAL(KIND=8), DIMENSION(SIZE(H_mesh%rr,2)) :: vv
541 
542  vv = 0.5d0*minval(inputs%sigma_fluid)
543  RETURN
544  END FUNCTION sigma_bar_in_fourier_space
545 
546 END MODULE boundary_test_21
section doc_intro_frame_work_num_app Numerical approximation subsection doc_intro_fram_work_num_app_Fourier_FEM Fourier Finite element representation The SFEMaNS code uses a hybrid Fourier Finite element formulation The Fourier decomposition allows to approximate the problem’s solutions for each Fourier mode modulo nonlinear terms that are made explicit The variables are then approximated on a meridian section of the domain with a finite element method The numerical approximation of a function f $f f is written in the following generic t
Definition: doc_intro.h:199
real(kind=8) function, dimension(size(rr, 2)), public source_in_ns_momentum(TYPE, rr, mode, i, time, Re, ty, opt_density, opt_tempn)
real(kind=8) function, dimension(size(rr, 2)), public pp_exact(TYPE, rr, m, t)
real(kind=8) function, dimension(h_mesh%np), public extension_velocity(TYPE, H_mesh, mode, t, n_start)
real(kind=8) function, dimension(size(rr, 2)), public source_in_level_set(interface_nb, TYPE, rr, m, t)
real(kind=8) function, dimension(size(h_mesh%rr, 2)), public sigma_bar_in_fourier_space(H_mesh)
subroutine, public init_maxwell(H_mesh, phi_mesh, time, dt, mu_H_field, mu_phi, list_mode, Hn1, Hn, phin1, phin)
real(kind=8) function, public jexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t, mesh_id, opt_B_ext)
real(kind=8) function, dimension(size(rr, 2)), public vv_exact(TYPE, rr, m, t)
real(kind=8) function, dimension(size(rr, 2)), public phiexact(TYPE, rr, m, mu_phi, t)
real(kind=8) function, public eexact_gauss(TYPE, rr, m, mu_phi, sigma, mu_H, t)
subroutine, public init_velocity_pressure(mesh_f, mesh_c, time, dt, list_mode, un_m1, un, pn_m1, pn, phin_m1, phin)
subroutine error_petsc(string)
Definition: my_util.f90:15
real(kind=8) function, dimension(size(rr, 2)), public level_set_exact(interface_nb, TYPE, rr, m, t)
real(kind=8) function, dimension(size(rr, 2)), public hexact(H_mesh, TYPE, rr, m, mu_H_field, t)
subroutine, public init_level_set(vv_mesh, time, dt, list_mode, level_set_m1, level_set)
section doc_intro_frame_work_num_app Numerical approximation subsection doc_intro_fram_work_num_app_Fourier_FEM Fourier Finite element representation The SFEMaNS code uses a hybrid Fourier Finite element formulation The Fourier decomposition allows to approximate the problem’s solutions for each Fourier mode modulo nonlinear terms that are made explicit The variables are then approximated on a meridian section of the domain with a finite element method The numerical approximation of a function f $f f is written in the following generic z
Definition: doc_intro.h:193