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