FUNCTION SET_INITIAL_CONDITIONS, UU=UU,VV=VV,WW=WW, xx=xx,yy=yy, zz=zz, rho0=rho0,pii0=pii0,theta0=theta0, nx=nx, ny=ny, nz=nz, del_x=del_x, del_y=del_y, del_t=del_t x0 = (nx-1)/2.0 & y0 = (ny-1)/2.0 & z0=(nz-1)/2.0 & PI=(22.0/7.0) xx=INDGEN(nx) & yy=INDGEN(ny) & zz=INDGEN(nz) & dd=FLTARR(nx) ;;;;FILL IN XX && YY ARRAYS ; This set the initial conditions for the usable points ; ;UU[*,*,*] = 0.0 & VV[*,*,*] = 0.0 & WW[*,*,*]= 0.0 x0 = (nx-1)/2.0 & y0 = (ny-1)/2.0 & z0=(nz-1)/2.0 for i = 0, nx-1 do begin for j = 0, ny-1 do begin UU[i,j,*] = 0 ;-0.20*(((nx-1)-j)-X0) VV[i,j,*] =0 ;-0.20*(((nY-1)-j)-y0) WW[i,j,*]= 0 ;-0.20*(((nZ-1)-j)-z0) endfor endfor ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;Fill the dd array from 10 to 50 centered at 30, with numbers, PG 1348 Tripoli 91 heights=INTARR(nx) & press=FLTARR(nx,ny,nz) & T_0=FLTARR(nx,ny,nz) heights=INDGEN(nx)*100.00 ;; height in meters p0= 1013.25 ;101325 ; Sea level HPa L0=0.0065 ;Lapse rate K/m T0=288.15 ;288.15 ; sea level temp K g0=9.8 ;gravity m/s M0=0.0289664 ;molar mass of dry air kg/mol R0=286.7 ;8.31447 ;Universal gas const. J/mol.k ;287.058 cp=1003.5 ;4.1855 ;specifi heat of air at cont. pres j/g.k k=1.3806503*10^(-23) ;;boltzmans constannt qq=((g0*M0)/(R0*L0)) r_cp=(R0/cp) ;theta0(*,*,*) = 250.0 ; in kelvin ;theta=FLTARR(nx,ny,nz) ;theta=(*,*,*)=theta0(*,*,*)+ ;for k = 1, nz-1 do pii0[*,*,k] = pii0[*,*,k-1] - ((g/theta[*,*,k])*(zz[k]-zz[k-1])) ; set initial P ;p_0 = fltarr(nx,ny,nz) ;p_0[*,*,0] = 100000.0 ; in Pa, mb ;pii0[*,*,0] = cp*((p_0[*,*,0]/100000.0)^(R/cp)) ;for k = 1, nz-1 do p_0[*,*,k] = 1000.0*((pii_0[*,*,k]/cp)^(cp/R)) ; for the blob ; if distb le 10.0 then theta0[i, j, k] = 3.0*(cos(2.0*(!pi*distb)/3000)) $ xb = (nx-1)/2 & yb = (ny-1)/2 & zb = (nz-1)/2 ; this should put a blob that is in the center of the x-y grid and closer to the "ground" in the z direction for i = 2, nx-2 do begin for j = 2, ny-2 do begin for k = 2, nz-2 do begin ;distb = sqrt(((i-1-xb)^2.0)+((j-1-yb)^2)+((k-1-zb)^2)) distb = sqrt(((i-1)^2.0)+((j-1)^2)+((k-1-zb)^2)) theta0[i,j,k] = theta0[i, j, k] + 300.0*((cos((!pi/2.0)*distb)))^2 ;$ ;some thing that will scale this from 0 to 10 with 10 in the center for the cone ;if distb le 10.0 then theta0[i,j,k] = theta0[i, j, k] + 300.0*((cos((!pi/2.0)*distb)))^2 $ ;some thing that will scale this from 0 to 10 with 10 in the center for the cone ; else theta0[i,j, 0] = 0.0 endfor endfor endfor ;;; Compute Pressure FOR i=0, nx-1 DO BEGIN FOR j=0, ny-1 DO BEGIN FOR k=0, nz-1 DO BEGIN press(i,j,k)=1013.25*(1- 0.0000225577*heights(k))^5.25588 ; cp*((p_0[*,*,0]/100000.0)^(R/cp)) pii0[i,j,K] = cp*((press(i,j,k))^r_cp) T_0[i,j,k] = (theta0[i,j,k]*pii0[i,j,k])/cp rho0[i,j,k] = press[i,j,k]/(R0*T_0[i,j,k]) ENDFOR ENDFOR ENDFOR IC={UU:UU,VV:VV, WW:WW, rho0:rho0, pii0:pii0, theta0:theta0, press:press, xx:xx,yy:yy,zz:zz, del_x:del_x, del_y:del_y, del_t:del_t, nx:nx, ny:ny, nz:nz} PRINT,'>>>>>>>>>> Initial conditions set >>>>>>>>>>' RETURN,IC END ;FOR i = 2, nx-3 DO BEGIN ; FOR j = 2, ny-3 DO BEGIN ; FOR k=2, nz-3 DO BEGIN ; theta0[i,j,K] =3.0*SIN(2*PI*dd(i)) ; pii0[i,j,K] = cp*((press(i,j,k)/100)^r_cp) ; ENDFOR ; ENDFOR ;ENDFOR ;FOR i=10, 50 DO BEGIN ; dd(i)=ABS(30-i) ;ENDFOR