|
#TEMPORARILY -> should be produced by GUI GLOBAL_VARIABLE _TIMEUNIT 5 "Year" GLOBAL_VARIABLE _SPACEUNIT 3 "Meter" #INPUT PARAMETERS GLOBAL_VARIABLE InertSolidPhase 0.35 "" DATABLOCK MineralProp -origin 1 -headings Name MolarVolume density GFW InitialVolume rate -rowid Name -start calcite 36.93336 2.71 100.09 30 5E-8 -end #WRITE KINETIC BLOCK TO KINETICS.IN #using datablock MineralProp CALCULATE_VALUES definition -state definition -mybasic -start tab$ = "RatesAq" mult$ = " * " qt$ = chr(34) empty$ = " " ds$="MineralProp" nrrec=get_defnrrec(ds$) def WriteKinetics() strkin = "KINETICS 1001" + EOL + "-material 1" + eol write("MINERAL REACTION NETWORK - Overview of kinetic parameters" + eol) for i=1 to nrrec mineral$=get_deflabel(ds$,i) volume=get_def(ds$,"InitialVolume",i) molarvolume=get_def(ds$,"MolarVolume",i) amount=volume*10/molarvolume rate=get_def(ds$,"rate",i)/CONV_T("s") strkin = strkin + mineral$ + eol strkin = strkin + " -m0 " + str(amount) + eol strkin = strkin + " -parms " + str(rate) + eol line$= mineral$ + " Amount (mol/dm�) " + str(amount) + " Rate(1/y) " + str(rate) write(line$ + eol) next i strkin = strkin + "-cvode true" + EOL strkin = strkin + EOL+EOL openf("kinetics.in") writef(strkin) closef() enddef WriteKinetics() -end #DEFINE RATE EQUATIONS RATES calcite -mybasic -start REM parm(1) k_0 mol/dm�/s MolarVolume = Get_Def("MineralProp","MolarVolume","calcite") phi0 = m0()*MolarVolume # initial bulk volume phi = m()*MolarVolume k_red = (phi/phi0)^(2/3) k = k_red*parm(1) rate = k*(1 - SR("Calcite")) mole = rate*time() if (mole > m()) then mole = m() save(mole) -end #UPDATE TRANSPORTPROPERTIES Calculate_values UpdateScaleFactors -mybasic -start solphase = get_var("InertSolidPhase") + sum_solid("kr","MineralProp","MolarVolume")/1000 porosity=1-solphase change_por(porosity) update_sfwater(porosity) if (total_time() < 1E-15) then a = ((1-porosity)^2 / porosity^3) put_def("IniFactor",a,cell_no()) else scale = (porosity^3 / (1-porosity)^2) * get_def("IniFactor",cell_no()) change_sfcond(scale) endif save(0) -end initial_por -state initial -mybasic -start a=calc_value("UpdateScaleFactors") Change_por0(get_por()) change_sfwater0(get_sfwater()) -end cal_update -state update -mybasic -start a = calc_value("UpdateScaleFactors") -end
|