32 INTEGER :: ndim,idim1,idim2,iupwind
33 INTEGER :: nrho,irho1,irho2,irhop,irhom
36 REAL (R8) :: rho(
solver%nrho)
48 REAL (R8) :: u(
solver%ndim,2)
49 REAL (R8) :: v(
solver%ndim,2)
50 REAL (R8) :: w(
solver%ndim,2)
56 REAL (R8) :: h(
solver%nrho)
59 REAL (R8) :: ww(2,
solver%ndim)
87 rho_loop1:
DO irho1 = 1,nrho
88 rho(irho1) =
solver%RHO(irho1)
90 dim_loop1:
DO idim1 = 1,ndim
91 y(idim1,irho1) =
solver%Y(idim1,irho1)
92 ym(idim1,irho1) =
solver%YM(idim1,irho1)
93 dy(idim1,irho1) =
solver%DY(idim1,irho1)
95 a(idim1,irho1) =
solver%A(idim1,irho1)
96 b(idim1,irho1) =
solver%B(idim1,irho1)
97 c(idim1,irho1) =
solver%C(idim1,irho1)
98 d(idim1,irho1) =
solver%D(idim1,irho1)
99 e(idim1,irho1) =
solver%E(idim1,irho1)
100 f(idim1,irho1) =
solver%F(idim1,irho1)
101 g(idim1,irho1) =
solver%G(idim1,irho1)
103 dim_loop2:
DO idim2 = 1,ndim
104 cm1(idim1,idim2,irho1) =
solver%CM1(idim1,idim2,irho1)
107 u(idim1,1) =
solver%U(idim1,1)
108 v(idim1,1) =
solver%V(idim1,1)
109 w(idim1,1) =
solver%W(idim1,1)
110 u(idim1,2) =
solver%U(idim1,2)
111 v(idim1,2) =
solver%V(idim1,2)
112 w(idim1,2) =
solver%W(idim1,2)
123 ww(idim1,idim2) = w(idim2,idim1)
130 h(irhom) = rho(irho1)-rho(irhom)
135 uu(1,idim1,idim1) = - v(idim1,1)/h(1)+u(idim1,1)
136 vv(1,idim1,idim1) = v(idim1,1)/h(1)
137 uu(2,idim1,idim1) = v(idim1,2)/h(nrho-1)+u(idim1,2)
138 vv(2,idim1,idim1) = - v(idim1,2)/h(nrho-1)
141 doloop1irho1:
DO irho1 = 2,nrho-1
144 h12 = 0.5*(h(irho1)+h(irhom))
146 doloop2idim1 :
DO idim1 = 1,ndim
147 ff(irho1,idim1) = b(idim1,irho1)*ym(idim1,irho1)+f(idim1,irho1)*tau
148 aa(irho1,idim1,idim1) = -0.5/c(idim1,irho1)/h(irho1)/ h12 &
149 * (d(idim1,irho1)+ d(idim1,irhop))
150 cc(irho1,idim1,idim1) = -0.5/c(idim1,irho1)/h(irhom)/ h12 &
151 * (d(idim1,irho1)+ d(idim1,irhom))
152 bb(irho1,idim1,idim1) = -aa(irho1,idim1,idim1) -cc(irho1,idim1,idim1)
154 IF (iupwind.NE.1)
THEN
155 aa(irho1,idim1,idim1) = aa(irho1,idim1,idim1) &
156 + 0.25 /c(idim1,irho1)/h12 &
157 * (e(idim1,irho1)+e(idim1,irhop))
158 cc(irho1,idim1,idim1) = cc(irho1,idim1,idim1) &
159 - 0.25 /c(idim1,irho1)/h12 &
160 * (e(idim1,irho1)+e(idim1,irhom))
161 bb(irho1,idim1,idim1) = bb(irho1,idim1,idim1) &
162 + 0.25 /c(idim1,irho1)/h12 &
163 * (e(idim1,irhop)-e(idim1,irhom))
165 IF (e(idim1,irho1).GE.0.)
THEN
166 cc(irho1,idim1,idim1) = cc(irho1,idim1,idim1) &
167 - e(idim1,irhom)/c(idim1,irho1)/h12
168 bb(irho1,idim1,idim1) = bb(irho1,idim1,idim1) &
169 + e(idim1,irho1) / c(idim1,irho1)/h12
171 aa(irho1,idim1,idim1) = aa(irho1,idim1,idim1) &
172 + e(idim1,irhop)/c(idim1,irhop)/h12
173 bb(irho1,idim1,idim1) = bb(irho1,idim1,idim1) &
174 + e(idim1,irho1) / c(idim1,irho1)/h12
179 bb(irho1,idim1,idim1) = bb(irho1,idim1,idim1)+g(idim1,irho1)
182 bb(irho1,idim1,idim2) = bb(irho1,idim1,idim2)
229 bb(irho1,idim1,idim1) = bb(irho1,idim1,idim1)+ a(idim1,irho1)
236 CALL
mprogonka(nrho,ndim,aa,bb,cc,ff,uu,vv,ww,yy)
242 y(idim1,irho1) = yy(irho1,idim1)*amix+y(idim1,irho1)*(1.e0_r8-amix)
246 CALL
derivn3(nrho,ndim,rho,y,dy)
252 solver%Y(idim1,irho1) = y(idim1,irho1)
253 solver%DY(idim1,irho1) = dy(idim1,irho1)
300 INTEGER,
INTENT(IN) :: np
302 INTEGER,
INTENT(IN) :: ndim
304 REAL(R8),
DIMENSION(NP,NDIM,NDIM),
INTENT(IN) :: a, b, c
306 REAL(R8),
DIMENSION(NP,NDIM),
INTENT(IN) :: f
308 REAL(R8),
DIMENSION(2,NDIM,NDIM),
INTENT(IN) :: u,v
310 REAL(R8),
DIMENSION(2,NDIM),
INTENT(IN) :: w
312 REAL(R8),
DIMENSION(NP,NDIM),
INTENT(OUT) :: y
316 REAL(R8),
DIMENSION(NP,NDIM,NDIM) :: alf
317 REAL(R8),
DIMENSION(NP,NDIM) :: bet
318 REAL(R8),
DIMENSION(NDIM,NDIM) :: temp1,temp2,temp3
319 REAL(R8),
DIMENSION(NP,NDIM) :: wekt1
320 REAL(R8),
DIMENSION(NDIM) :: wekt2
321 INTEGER :: i, j, j2, k, n, nn, n2
322 REAL(R8) :: stemp1,stemp2,det
329 alf(2,1,1) =-v(1,1,1)/u(1,1,1)
330 bet(2,1)= w(1,1)/u(1,1,1)
334 det=b(j,1,1)+alf(j,1,1)*c(j,1,1)
335 IF(abs(det).GT.1.e-30_r8)
THEN
336 alf(j2,1,1)=-a(j,1,1)/det
337 bet(j2,1)=(f(j,1)-bet(j,1)*c(j,1,1))/det
346 det=v(2,1,1)*alf(np,1,1)+u(2,1,1)
347 IF(abs(det).GT.1.e-30_r8) y(np,1)=(w(2,1)-bet(np,1)*v(2,1,1))/det
351 y(j,1)=alf(j2,1,1)*y(j2,1)+bet(j2,1)
369 alf(2,i,j)=alf(2,i,j)-temp2(i,k)*v(1,k,j)
371 bet(2,i)=bet(2,i)+temp2(i,j)*w(1,j)
381 temp1(i,j)=temp1(i,j)+c(n,i,k)*alf(n,k,j)
383 wekt1(n,i)=wekt1(n,i)-c(n,i,j)*bet(n,j)
394 alf(n2,i,j)=alf(n2,i,j)-temp2(i,k)*a(n,k,j)
396 bet(n2,i)=bet(n2,i)+temp2(i,j)*wekt1(n,j)
402 1001
FORMAT(1x,3i4,1
p,8e12.4)
411 temp1(i,j)=temp1(i,j)+v(2,i,k)*alf(np,k,j)
413 wekt2(i)=wekt2(i)-v(2,i,j)*bet(np,j)
421 y(np,i)=y(np,i)+temp2(i,j)*wekt2(j)
430 y(n,i)=y(n,i)+alf(n2,i,j)*y(n2,j)
473 INTEGER,
INTENT(IN) :: n
475 REAL(R8),
DIMENSION(n,n),
INTENT(IN) :: aa
478 REAL(R8),
DIMENSION(n,n),
INTENT(OUT) :: ainv
481 REAL(R8),
DIMENSION(n) :: scale
482 REAL(R8),
DIMENSION(n,n) :: b
483 REAL(R8),
DIMENSION(n,n) :: a
484 INTEGER,
DIMENSION(n) :: index
485 INTEGER :: i, j, k, jpivot, indexj
486 REAL(R8) :: scalemax, ratio, ratiomax, coeff, determ, sum
512 if( abs(a(i,j)) .gt. scalemax )
then
513 scalemax = abs(a(i,j))
525 ratio = abs(a(index(i),k))/scale(index(i))
526 if( ratio .gt. ratiomax )
then
533 if( jpivot .ne. k )
then
534 indexj = index(jpivot)
535 index(jpivot) = index(k)
540 coeff = a(index(i),k)/a(indexj,k)
542 a(index(i),j) = a(index(i),j) - coeff*a(indexj,j)
544 a(index(i),k) = coeff
546 b(index(i),j) = b(index(i),j) - a(index(i),k)*b(indexj,j)
554 ainv(n,k) = b(index(n),k)/a(index(n),n)
558 sum = sum - a(index(i),j)*ainv(j,k)
560 ainv(i,k) = sum/a(index(i),i)
598 REAL (R8) :: h(n),dy2(n)
613 dy1(i) = ((y(i+1)-y(i))*h(i-1)/h(i)+(y(i)-y(i-1))*h(i)/h(i-1)) &
615 dy2(i) = 2.e0_r8*((y(i-1)-y(i))/h(i-1)+(y(i+1)-y(i))/h(i)) &
619 dy1(1) = dy1(2)-dy2(2)*h(1)
620 dy1(n) = dy1(n-1)+dy2(n-1)*h(n-1)
624 dfun(ifun,i) = dy1(i)
subroutine solution3(SOLVER, ifail)
This subroutine solves transport equations using matrix PROGONKA method.
subroutine mprogonka(NP, NDIM, A, B, C, F, U, V, W, Y)
Finds Solution of discrete equation of the form A_i * Y_i+1 + B_i * Y_i +C_i * Y_i-1 = F_i where: Y_i...
subroutine derivn3(N, NFUN, X, FUN, DFUN)
These subroutines calculate first and second derivatives, DY1 and DY2, of function Y respect to argum...
real(r8) function p(a, x, xr, xs, yr, ys, psi, psir, F_dia)
subroutine invmatrix(n, AA, Ainv)
Computes inverse of matrix Input AA - Matrix A (n by n) N - Dimension of matrix AA.