restart = 0; ! New problem title ='VD.035.004 Bartolomei'; ! KORSAR version number and short title dt_max = 0.01; ! Maximum time integration step dt_out = 0.1; ! Calculation output step fin_tim = 21.; ! Calculation end time ngas = 'h2o,n2'; ! Noncondensable gases p1 =14.74e6; rw=1847.; q0=0.77e6; t1=598.; ltr=1.5;!data from Table pi = acos(-1.); ! calculate and set number pi (=3.1415926) diam = 0.012; ! enter user variable for pipe diameter dst = 0.002; ! same for wall thickness i = 0; ! same for cycle counter for event calc procedure a = 0.; ! auxiliary variable for setting disturbances ! Variables for calculation of balance and actual void fractions x12 = 0.; fi12 = 0.; x16 = 0.; fi16 = 0.; x19 = 0.; fi19 = 0.; nch = 20; ! user variable for the number of volumes dztr = ltr/nch; ! user variable for the volume length lob = dztr*nch; ! calculated length qst = q0*(pi*diam*lob); ! calculate the pipe heating power gw = rw*(pi*diam*diam/4.); ! calculate water flow rate void(1:nch) = 0.; ! user array for void fractions xst(1:nch) = 0.; ! user array for balance void fractions xst1 = 0.; xst2 = 0.; ! user variables for balance void fractions !Procedure for setting connections between elements layout ch1/i - bljun1; ! channel input connects to blocked junction ch1/o - bvol_t1; ! channel output connects to boundary volume hcs1(1:nch)/1 - ch1(2:nch+1);!nch heat conduction structure volumes (surface 1) !connect to nch channel volumes beginning from 2d volume hcs1(1:nch)/2 - bheat1; ! nch heat conduction structure volumes (surface 2) ! connect to heat transfer boundary condition qhcs_t1 - hcs1; !heat conduction structure power connects to heat conduction ! structure smass_t1 - ch1(1); ! mass source connects to 1st channel volume end ! end of procedure for setting connections between elements !Calls of data procedures (each call activates reading of data) call ch1; call hcs1; call bljun1; call bvol_t1; call smass_t1; call bheat1; call qhcs_t1; ! Calls of event procedures, i.e. at each time step (for type = 0), statements ! of called procedures will be executed (for other type see. [2]). set calc; ! calculation of balance void fractions set vozm; ! setting of heating power in qhcs_t1 and water flow rate in smass_t1 !Activation of list of output data recorded to korres file out a; end ! End of active part (sequence of executable statements) !Passive part of input file (data for calculation) data ch1 ! data procedure block for channel ch1 n = nch+1; ! number of volumes s = pi * diam ** 2./4.; ! flow area of volumes pr = pi * diam; ! wetted perimeter of volumes dz = dztr; ! length of volumes dh = dztr; ! drop of height of volumes p = p1; ! (initial) pressure in volumes t(1,1:n) = ws1p1(1,'p',p1,2); ! liquid phase temperature in volumes ! (calculation using built-in function on saturation line at pressure p1) t(2,1:n) = ws1p1(2,'p',p1,2); ! vapor phase temperature in volumes void = 0.; ! void fraction in volumes end ! end of data procedure block for channel ch1 data hcs1 ! data procedure block for heat conduction structure hcs1 n = nch; ! number of volumes kl = 1; ! number of layers with different properties k = 3; ! number of nodes with different properties type = 0; ! model type (0 - one-dimensional model) coor = 1; ! flag of coordinate system (1 - cylindrical) xl = diam/2.,(diam/2.) + dst; ! coordinates of layer boundaries x = diam/2.,(diam + dst)/2.,(diam/2.) + dst; ! coordinates of nodes lam = 19.; ! heat conductivity of layer material cr = 2.25e6; ! product of heat capacity by density for layer material qx = 1.; ! relative power levels in layers dfz = dztr; ! length of volumes qz = 1./(nch); ! relative power distribution in volumes end ! end of data procedure block for heat conduction structure hcs1 data bvol_t1 ! data procedure block for boundary volume bvol_t1 p = p1; ! (initial) pressure t(1) = ws1p1(1,'p',p1,2); ! liquid phase temperature t(2) = ws1p1(2,'p',p1,2); ! vapor phase temperature void = 0.; ! void fraction end ! end of data procedure block for boundary volume bvol_t1 data bljun1 ! data procedure block for blocked junction bljun1 type = 1; ! flag of to-volume phase orientation relative to channel axis: ! (using SMASS_T1 with inflow to the 1st volume of channel) ! (1 - liquid - parallel; gas - perpendicular) end ! end of data procedure block for blocked junction bljun1 data smass_t1 ! data procedure block for mass source smass_t1 gin(1) = 0.; ! (initial) liquid phase inflow to volume gin(2) = 0.; ! (initial) vapor phase inflow to volume ehin(1) = ws2p1(1,'pt',p1,t1,4); ! (initial) enthalpy of liquid phase inflow ! to volume ehin(2) = ws1p1(2,'p',p1,4); ! (initial) enthalpy of vapor phase inflow ! to volume end ! end of data procedure block for mass source smass_t1 data bheat1 ! data procedure block for heat transfer boundary condition bheat1 type = 2; ! type of boundary condition: 2 - Type II boundary condition bcond(1:2) = 0.; ! bcond(1) - heat flux from surface, bcond(2)-not used end ! end of data procedure block data qhcs_t1 ! data procedure block for q = 0.; ! (initial) power in heat conduction structure end ! end of data procedure block event calc ! block for calculation of relative balance void fraction do i=1,nch; ! cycle over all volumes of channel ch1 xst1 = "($w.ch1(2,i),-1); ! calculation of relative balance void fraction at ! inlet junction of volume i using built-in ! function "Quotes with two arguments" xst2 = "($w.ch1(2,i+1),-1); ! same for outlet junction of volume i xst(i) = (xst1+xst2)/2.;! calculation of average balance void fraction ! in volume void(i) = void.ch1(i+1); ! filling of array with volume void fraction values enddo; ! end of cycle over volumes of channel ch1 end ! end of block (event calc procedure) event vozm ! block for initial increase in flow rate and power ! linear increase in inlet flow rate for 5 seconds if tau > 1. then; a = max(0.,min(1.,(tau - 1.)/5.)); gin.smass_t1(1) = gw * a; endif; ! linear increase in heat flux to channel wall, ! for five seconds beginning from the fifth second if tau > 5. then; a = max(0.,min(1.,(tau - 5.)/5.)); q.qhcs_t1 = qst*a; endif; print tau; ! display of current run time end ! end of block (event vozm procedure) !block of procedure to generate a list of variables for output to korrres file output a write void, xst, gin.smass_t1(1), q.qhcs_t1, void.ch1; end