33 REAL(KIND=8) :: pi=ACOS(-1.d0)
41 un_m1, un, pn_m1, pn, phin_m1, phin)
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
50 REAL(KIND=8),
DIMENSION(mesh_c%np) :: pn_m2
53 DO i= 1,
SIZE(list_mode)
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)
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)
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
82 DO i= 1,
SIZE(list_mode)
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
132 CHARACTER(LEN=2) :: np
134 IF (present(opt_density)) CALL
error_petsc(
'density should not be present for test 8')
144 ur = r**3*cos(2*pi*
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
154 + (ur*2*r*
z + ut*r**2*cos(2*pi*
z)&
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)
166 IF (
TYPE .GE. 5) then
168 + inputs%gravity_coefficient*opt_tempn(:,type-4,i)
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
197 ur = r**3*cos(2*pi*
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
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)
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
259 vv(:) = r**3*cos(2*pi*
z)
260 ELSE IF (
TYPE == 2) then
262 ELSE IF (
TYPE == 3) then
264 ELSE IF (
TYPE == 4) then
266 ELSE IF (
TYPE == 5) then
267 vv(:) = -(2*r**2/pi)*sin(2*pi*
z)
268 ELSE IF (
TYPE == 6) then
271 vv(:) = vv(:) * sin(
t)
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
309 vv(:) = 0.5d0*((r**3*cos(2*pi*
z))**2 &
311 + ((2*r**2/pi)*sin(2*pi*
z))**2)*sin(
t)**2
312 ELSE IF (
TYPE == 2) then
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
336 IF(m==0 .AND. type==1)
THEN
338 ELSE IF (m==0 .AND. type==2)
THEN
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
344 ELSE IF (m==2 .AND. type==1)
THEN
346 ELSE IF (m==2 .AND. type==2)
THEN
347 vv = 2*r**2*
z**2*cos(
t)
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
408 n=h_mesh%np; r=
t; n=type; n=mode; n=n_start
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
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)
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