58 INTEGER,
PARAMETER :: MAXEQN = 2,MAXRCT = 1
59 INTEGER :: nreaction,ntemp_spec,maxnwtn
60 REAL(RFREAL) :: eps,epy,beta,cpGas
61 REAL(RFREAL) :: damkholer(MAXRCT),mx(MAXEQN),mn(MAXEQN),nn(MAXRCT), &
62 pre(MAXRCT),qg(MAXRCT),thetay(MAXRCT),VEC(MAXEQN)
63 REAL(RFREAL) :: MAT(MAXEQN,MAXEQN),yf(MAXEQN,MAXRCT)
64 REAL(RFREAL) :: ratey(MAXRCT)
107 TYPE(t_region
),
POINTER :: pregion
113 CHARACTER(CHRLEN) :: errorstring,rcsidentstring
114 INTEGER :: icg,indcp,indmol,ispec,nout,ncumul,ibc,iec,callflag
115 REAL(RFREAL) :: fact,ggas,ir,molmass,p,
r,rgas,t,u,
v,w,rvcumul,
x,
y,aaa,bbb
116 REAL(RFREAL),
DIMENSION(MAXEQN) :: f,f_old
117 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcvmixt,pcvspec,pdvmixt,pgvmixt,mrhs,srhs
118 REAL(RFREAL),
DIMENSION(:),
POINTER :: vol
119 TYPE(t_grid),
POINTER :: pgrid
126 rcsidentstring =
'$RCSfile: SPEC_RFLU_ModChemistry.F90,v $ $Revision: 1.6 $'
128 global => pregion%global
131 'SPEC_RFLU_ModChemistry.F90')
137 pgrid => pregion%grid
139 pcvmixt => pregion%mixt%cv
140 pdvmixt => pregion%mixt%dv
141 pgvmixt => pregion%mixt%gv
142 pcvspec => pregion%spec%cv
143 mrhs => pregion%mixt%rhs
144 srhs => pregion%spec%rhs
145 vol => pregion%grid%vol
147 indcp = pregion%mixtInput%indCp
148 indmol = pregion%mixtInput%indMol
159 IF ( pregion%mixt%cvState /= cv_mixt_state_cons )
THEN
160 CALL
errorstop(global,err_cv_state_invalid,__line__)
163 IF ( pregion%specInput%nSpecies /= maxeqn-1 )
THEN
164 WRITE(errorstring,
'(I3)') maxeqn
165 CALL
errorstop(global,err_spec_maxeqn,__line__,errorstring)
173 iec =
merge(pgrid%nCellsTot,pgrid%nCells,callflag == 0)
182 r = pcvmixt(cv_mixt_dens,icg)
185 x = pgrid%cofg(xcoord,icg)
186 y = pgrid%cofg(ycoord,icg)
187 t = pdvmixt(dv_mixt_temp,icg)
188 p = pdvmixt(dv_mixt_pres,icg)
190 molmass = pgvmixt(gv_mixt_mol,indmol*icg)
191 cpgas = pgvmixt(gv_mixt_cp ,indcp *icg)
201 pre(1) = damkholer(1)*p**nn(1)
210 if(callflag == 1)
then
211 ratey(1) = pre(1) * pcvspec(1,icg) * exp(-thetay(1)/t) /
r * global%dtMin
212 pcvmixt(cv_mixt_ener,icg) = pcvmixt(cv_mixt_ener,icg) + ratey(1)*yf(1,1)
213 pcvspec( 1,icg) = pcvspec( 1,icg) + ratey(1)*yf(2,1)
214 elseif(callflag == 0)
then
215 ratey(1) = pre(1) * pcvspec(1,icg) * exp(-thetay(1)/t) /
r * vol(icg)
217 mrhs(cv_mixt_ener,icg) = mrhs(cv_mixt_ener,icg) - ratey(1)*yf(1,1)
218 srhs(1,icg) = srhs(1,icg) - ratey(1)*yf(2,1)
264 TYPE(t_region
),
POINTER :: pregion
281 ntemp_spec = 1+pregion%specInput%nSpecies
285 thetay(1) = 15000_rfreal
287 qg(1) = 2511600.0_rfreal
291 damkholer(1) = 1174775.7803_rfreal
297 yf(2,1) = -1.0_rfreal
301 mx(1) = 6000.0_rfreal
306 mx(
n) = 1.0_rfreal - mn(
n)
349 REAL(RFREAL),
INTENT(IN) :: fact,press,rho,time_step
350 REAL(RFREAL),
DIMENSION(MAXEQN) :: old_f,f
357 INTEGER :: eqn,
i,icnvrgd,nout
358 REAL(RFREAL) :: toll,dt_over_rho
364 dt_over_rho = time_step/rho*fact
366 DO eqn = 1, ntemp_spec
374 CALL
odesolve(old_f(1:ntemp_spec),f(1:ntemp_spec),press, &
375 ntemp_spec,dt_over_rho,nout,outcome)
378 WRITE(*,*)
'DIVERGENCE IN RATE',old_f(1:ntemp_spec),f(1:ntemp_spec), &
380 f(1:ntemp_spec)=old_f(1:ntemp_spec)
416 SUBROUTINE odesolve(yin,y,press,neqin,dtout,nout,outcome)
429 INTEGER,
INTENT(IN) :: neqin,nout
430 REAL(RFREAL) :: dtout,press
431 REAL(RFREAL) ::
y(neqin),yin(neqin)
437 INTEGER :: icol,inwtn,iout,irow
438 REAL(RFREAL) :: t,tout
439 REAL(RFREAL) :: pp(maxeqn),ytmp(maxeqn)
445 dtout = dtout/
REAL(nout,kind=rfreal)
454 DO inwtn = 1, maxnwtn
459 vec(irow) = ytmp(irow) -
y(irow) + vec(irow)*dtout
462 IF ( icol == irow )
THEN
463 mat(irow,irow) = mat(irow,irow)*dtout - 1.0_rfreal
465 mat(irow,icol) = mat(irow,icol)*dtout
470 CALL
lusolve(mat(1:neqin,1:neqin),vec(1:neqin),neqin)
471 y(1:neqin) =
y(1:neqin) - vec(1:neqin)
481 outcome = (.NOT.
y(1) < mx(1)) .OR. (.NOT.
y(1) > mn(1))
485 WRITE (stdout,*)irow,
'TXY',yin(irow),
y(irow)
489 300
format(////
' STATE FLAG =',i3,/,
'FAILED INEGRATION')
535 REAL(RFREAL) :: press,time_stiff
536 REAL(RFREAL) :: ff(neqin),rrate(neqin)
543 REAL(RFREAL) :: ratey(maxrct)
544 REAL(RFREAL) :: dratey(maxrct,maxeqn)
550 pre(1) = damkholer(1)*press**nn(1)
552 ratey(1) = ff(2)*exp(-thetay(1)/ff(1))
554 ratey(1) = pre(1)*ratey(1)
559 rrate(
m) =
sum(yf(
m,1:nreaction)*ratey(1:nreaction))
587 SUBROUTINE drate_stiff(neqin,time_stiff,ff,press,ml,imu,drate,nrowpd)
599 INTEGER :: neqin,ml,imu
600 REAL(RFREAL) :: press,time_stiff
601 REAL(RFREAL) :: ff(neqin),drate(nrowpd,neqin)
602 REAL(RFREAL) :: dratey(maxrct,maxeqn)
608 INTEGER ::
m,
n,nrowpd
609 REAL(RFREAL) :: tsqinv
610 REAL(RFREAL) :: ratey(maxrct)
616 pre(1) = damkholer(1)*press**nn(1)
618 tsqinv = 1.0_rfreal/(ff(1)*ff(1))
620 ratey(1) = ff(2)*exp(-thetay(1)/ff(1))
622 ratey(1) = pre(1)*ratey(1)
624 dratey(1,1) = thetay(1)*ratey(1)*tsqinv
625 dratey(1,2) = ratey(1)/
merge(eps,ff(2),ff(2)==0.0_rfreal)
631 drate(
m,
n) =
sum(yf(
m,1:nreaction)*dratey(1:nreaction,
n))
675 REAL(RFREAL) ::
a(
n,
n)
683 REAL(RFREAL),
DIMENSION(MAXEQN) ::
b,
y
684 REAL(RFREAL),
DIMENSION(MAXEQN,MAXEQN) :: u,l
695 l(2:
n,1) =
a(2:
n,1)/
a(1,1)
699 d = 1.0_rfreal/u(
i,
i)
Tfloat sum() const
Return the sum of all the pixel values in an image.
subroutine rate_split(f, old_f, rho, press, fact, time_step, nout)
real(rfreal) function mixtperf_r_m(M)
void int int REAL REAL * y
subroutine registerfunction(global, funName, fileName)
real(rfreal) function mixtperf_d_prt(P, R, T)
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
subroutine set_rate(pRegion)
subroutine rate_stiff(neqin, time_stiff, ff, press, rrate)
subroutine lusolve(A, f, n)
subroutine drate_stiff(neqin, time_stiff, ff, press, ml, imu, drate, nrowpd)
subroutine, public spec_rflu_integratechemsrcterm(pRegion, CALLFLAG)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to merge
real(rfreal) function mixtperf_g_cpr(Cp, R)
real(rfreal) function mixtperf_eo_grtuvw(G, R, T, U, V, W)
subroutine odesolve(yin, y, press, neqin, dtout, nout, outcome)