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