Martin, C. and A. Urquia and S. Dormido (2005a): Modeling of Interactive Virtual Laboratories with Modelica Proceedings of the 4th International Modelica Conference, 159-168.
Martin, C. and A. Urquia and S. Dormido (2005b): Modelado Orientado a Objetos de Laboratorios Virtuales con Aplicación a la Enseñanza de Control de Procesos Químicos. Proceedings of the 1st Congreso Español de Informática (CEDI-EIWISA).
| Name | Description |
|---|---|
| DoublePipeHeatExchangerInteractive | Double pipe heat exchanger interactive model |
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | nCompL | 1 | Number of components of the liquid mixture |
| Integer | nCompG | 2 | Number of components of the gas mixture |
| Boolean | Ejs | true | Global variable - Runtime Interactivity |
| Boolean | Sysquake | false | Global variable - Batch interactivity |
| Real | pi | 3.141593 | |
| Integer | numNodes | 10 | Number of nodes for temperature calculation |
| Real | perfGasConst | 8.31 | Perfect gases constant [J/(mol.K)] |
| Real | densityL[nCompL] | {996} | Density of the liquid components [Kg.m-3] |
| Real | CpCoefML[nCompL, 7] | [4185, 0, 0, 0, 0, 0, 0] | Heat capacity [J/(Kg.K)] |
| Real | viscLiq[4] | {1,-10.547,541.69,144.53} | Viscosity coefficients [W/(m.K)] |
| Real | thermCondL[2] | {0.61,0} | Thermal conductivity coefficients |
| Real | CpCoefNG[nCompG, 7] | [36.83, 0, 0, 0, 0, 0, 0; 42... | Heat capacity per mol at constant pressure [J/(mol.K)] |
| Real | CpCoefMG[nCompG, 7] | [837, 0, 0, 0, 0, 0, 0; 657,... | Heat capacity per mass at constant [J/(Kg.K)] |
| Real | viscGas[4] | {1.55E-5,0,0,1} | Viscosity [Kg/(m.s)] |
| Real | thermCondG[2] | {0.014,0} | Coeff. of the thermal conductivity [W/(m.K)] |
| Real | molecWeigthG[2] | {44E-3,64E-3} | Molecular weight [Kg/mol] |
| Real | lenPipeInitial | 1 | Pipe lenght [m] |
| Real | pipeDiameter1Initial | 18.92E-3 | Inner diameter of the inside tube [m] |
| Real | pipeDiameter2Initial | 22.22E-3 | Outer diameter of the inside tube [m] |
| Real | pipeDiameter3Initial | 38.10E-3 | Inner diameter of the outside pipe [m] |
| Real | sectionIntInitial | (pi*(pipeDiameter1Initial/2)... | [m2] |
| Real | areaIntInitial | (pi*pipeDiameter1Initial*len... | [m2] |
| Real | areaExtInitial | (pi*pipeDiameter2Initial*len... | [m2] |
| Real | volElemIntInitial | (sectionIntInitial*lenPipeIn... | [m3] |
| Real | volElemGasInitial | volElemIntInitial | [m3] |
| Real | sectionExtInitial | (pi*((pipeDiameter3Initial/2... | [m2] |
| Real | volElemLiqInitial | sectionExtInitial*lenPipeIni... | [m3] |
| Real | pmax | 1E9 | Characteristic parameters of the source and pumps |
| Real | pcodo | 0.9E9 | |
| Real | pmin | 2E-2 | |
| Real | peps | 1E-2 | |
| Real | massFractionLSP[nCompL] | {1} | Setpoint: mass fraction of the liquid |
| Real | densityIntPipeWall | 8950 | Density of the inside-tube wall [Kg/m3] |
| Real | CpIntPipeWall[7] | {383,0,0,0,0,0,0} | Heat capacity of the inside-tube wall [J/(Kg.K)] |
| Real | thermalCondWall | 381 | Thermal conductivity of the inside-tube wall [W/(m.K)] |
| Real | pipeWallSectionInitial | (pi*((pipeDiameter2Initial/2... | |
| Real | massIntPipeWallInitial | (densityIntPipeWall*lenPipeI... | |
| Real | massElemPipeInitial | (massIntPipeWallInitial/(num... | |
| Real | thermalResistanceInitial | (lenPipeInitial/(thermalCond... | |
| Real | STcoefLiq[4] | {0.023,0.8,0.4,0} | Sieder-Tate correlation coefficients |
| Real | STcoefGas[4] | {0.023,0.8,0.3,0} | Sieder-Tate correlation coefficients |
| Real | tempInitialWall[numNodes - 1] | fill(283, (numNodes - 1)) | Wall initial temperature [K] |
| Real | tempInitialLiq[numNodes] | fill(283, numNodes) | Liquid initial temperature [K] |
| Real | tempInitialGas[numNodes] | fill(283, numNodes) | Gas initial temperature [K] |
| Real | initialLiqMassFraction[nCompL] | {1} | Initial mass-fraction of the liquid mixture components |
| Real | massInitialLiq[nCompL] | volElemLiqInitial*initialLiq... | Initial mass of liquid inside a control volume [Kg] |
| Real | molFractGasInitial[nCompG] | {0.5,0.5} | Initial mol fraction of the gas components |
| Real | gasPressureInitial | 5e5 | Initial pressure of the gas mixture [J.m-3] |
model DoublePipeHeatExchangerInteractive
"Double pipe heat exchanger interactive model"
// Physical model
extends PhysicalModel.DoublePipeHeatExchanger;
// Interface
input Real Iparam[4];
input Real Ivar[5];
input Real Istate[31];
input Real CKparam;
input Real CKvar;
input Real CKstate;
output Real O[36];
output Real Release;
protected
Boolean CKparamIs0( start = true, fixed=true);
Boolean CKvarIs0( start = true, fixed=true);
Boolean CKstateIs0( start = true, fixed=true);
equation
// Model release
// -------------
{Release} = {2.0};
// Interactive change of the parameters
// ------------------------------------
when CKparam > 0.5 and pre(CKparamIs0) or CKparam
< 0.5 and not pre(CKparamIs0) then
CKparamIs0 =CKparam < 0.5;
reinit(lenPipe,Iparam[1]);
reinit(pipeDiameter1,Iparam[2]);
reinit(pipeDiameter2,Iparam[3]);
reinit(pipeDiameter3,Iparam[4]);
// El cambio en la geometria del intercambiador hace que cambie el volumen de los volumenes
// de control de gas.
reinit(volCntrlGas1.vessel.vesselVolume,
0.5 * pi * (pipeDiameter1/2)^ 2 * lenPipe / (numNodes - 1));
reinit(volCntrlGas2.vessel.vesselVolume,
pi * (pipeDiameter1/2)^ 2 * lenPipe / (numNodes - 1));
reinit(volCntrlGas3.vessel.vesselVolume,
pi * (pipeDiameter1/2)^ 2 * lenPipe / (numNodes - 1));
reinit(volCntrlGas4.vessel.vesselVolume,
pi * (pipeDiameter1/2)^ 2 * lenPipe / (numNodes - 1));
reinit(volCntrlGas5.vessel.vesselVolume,
pi * (pipeDiameter1/2)^ 2 * lenPipe / (numNodes - 1));
reinit(volCntrlGas6.vessel.vesselVolume,
pi * (pipeDiameter1/2)^ 2 * lenPipe / (numNodes - 1));
reinit(volCntrlGas7.vessel.vesselVolume,
pi * (pipeDiameter1/2)^ 2 * lenPipe / (numNodes - 1));
reinit(volCntrlGas8.vessel.vesselVolume,
pi * (pipeDiameter1/2)^ 2 * lenPipe / (numNodes - 1));
reinit(volCntrlGas9.vessel.vesselVolume,
pi * (pipeDiameter1/2)^ 2 * lenPipe / (numNodes - 1));
reinit(volCntrlGas10.vessel.vesselVolume,
0.5 * pi * (pipeDiameter1/2)^ 2 * lenPipe / (numNodes - 1));
// El cambio en la geometria del intercambiador modifica la cantidad de agua en
// los volúmenes de control, de modo que siempre se encuentren llenos de agua
reinit(volCntrlLiq1.liquid.massL[1],
0.5 * pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2) * lenPipe / (numNodes - 1) * densityL[1]);
reinit(volCntrlLiq2.liquid.massL[1],
pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2) * lenPipe / (numNodes - 1) * densityL[1]);
reinit(volCntrlLiq3.liquid.massL[1],
pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2) * lenPipe / (numNodes - 1) * densityL[1]);
reinit(volCntrlLiq4.liquid.massL[1],
pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2) * lenPipe / (numNodes - 1) * densityL[1]);
reinit(volCntrlLiq5.liquid.massL[1],
pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2) * lenPipe / (numNodes - 1) * densityL[1]);
reinit(volCntrlLiq6.liquid.massL[1],
pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2) * lenPipe / (numNodes - 1) * densityL[1]);
reinit(volCntrlLiq7.liquid.massL[1],
pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2) * lenPipe / (numNodes - 1) * densityL[1]);
reinit(volCntrlLiq8.liquid.massL[1],
pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2) * lenPipe / (numNodes - 1) * densityL[1]);
reinit(volCntrlLiq9.liquid.massL[1],
pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2) * lenPipe / (numNodes - 1) * densityL[1]);
reinit(volCntrlLiq10.liquid.massL[1],
0.5 * pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2) * lenPipe / (numNodes - 1) * densityL[1]);
// El cambio en la geometria del intercambiador modifica la masa de los elementos de pared
reinit(pipeWall1.mass,
densityIntPipeWall * lenPipe * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) / (numNodes - 1));
reinit(pipeWall2.mass,
densityIntPipeWall * lenPipe * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) / (numNodes - 1));
reinit(pipeWall3.mass,
densityIntPipeWall * lenPipe * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) / (numNodes - 1));
reinit(pipeWall4.mass,
densityIntPipeWall * lenPipe * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) / (numNodes - 1));
reinit(pipeWall5.mass,
densityIntPipeWall * lenPipe * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) / (numNodes - 1));
reinit(pipeWall6.mass,
densityIntPipeWall * lenPipe * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) / (numNodes - 1));
reinit(pipeWall7.mass,
densityIntPipeWall * lenPipe * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) / (numNodes - 1));
reinit(pipeWall8.mass,
densityIntPipeWall * lenPipe * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) / (numNodes - 1));
reinit(pipeWall9.mass,
densityIntPipeWall * lenPipe * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) / (numNodes - 1));
// El cambio en la geometria del intercambiador modifica la conduccion de calor en la pared
reinit(condHeat12.Rth,
lenPipe / ( thermalCondWall * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) * ( numNodes - 1)));
reinit(condHeat23.Rth,
lenPipe / ( thermalCondWall * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) * ( numNodes - 1)));
reinit(condHeat34.Rth,
lenPipe / ( thermalCondWall * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) * ( numNodes - 1)));
reinit(condHeat45.Rth,
lenPipe / ( thermalCondWall * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) * ( numNodes - 1)));
reinit(condHeat56.Rth,
lenPipe / ( thermalCondWall * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) * ( numNodes - 1)));
reinit(condHeat67.Rth,
lenPipe / ( thermalCondWall * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) * ( numNodes - 1)));
reinit(condHeat78.Rth,
lenPipe / ( thermalCondWall * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) * ( numNodes - 1)));
reinit(condHeat89.Rth,
lenPipe / ( thermalCondWall * pi * ( (pipeDiameter2/2)^ 2 - (pipeDiameter1/2)^ 2) * ( numNodes - 1)));
// El cambio en la geometria del intercambiador modifica la conveccion de calor liquido - pared
reinit(convHeatFL1.pipeDiameter, pipeDiameter2);
reinit(convHeatFL2.pipeDiameter, pipeDiameter2);
reinit(convHeatFL3.pipeDiameter, pipeDiameter2);
reinit(convHeatFL4.pipeDiameter, pipeDiameter2);
reinit(convHeatFL5.pipeDiameter, pipeDiameter2);
reinit(convHeatFL6.pipeDiameter, pipeDiameter2);
reinit(convHeatFL7.pipeDiameter, pipeDiameter2);
reinit(convHeatFL8.pipeDiameter, pipeDiameter2);
reinit(convHeatFL9.pipeDiameter, pipeDiameter2);
reinit(convHeatFL1.pipeSection, pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2));
reinit(convHeatFL2.pipeSection, pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2));
reinit(convHeatFL3.pipeSection, pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2));
reinit(convHeatFL4.pipeSection, pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2));
reinit(convHeatFL5.pipeSection, pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2));
reinit(convHeatFL6.pipeSection, pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2));
reinit(convHeatFL7.pipeSection, pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2));
reinit(convHeatFL8.pipeSection, pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2));
reinit(convHeatFL9.pipeSection, pi * ( (pipeDiameter3/2)^ 2 - (pipeDiameter2/2)^ 2));
reinit(convHeatFL1.pipeSurfaceArea, pi * pipeDiameter2 * lenPipe / (numNodes - 1));
reinit(convHeatFL2.pipeSurfaceArea, pi * pipeDiameter2 * lenPipe / (numNodes - 1));
reinit(convHeatFL3.pipeSurfaceArea, pi * pipeDiameter2 * lenPipe / (numNodes - 1));
reinit(convHeatFL4.pipeSurfaceArea, pi * pipeDiameter2 * lenPipe / (numNodes - 1));
reinit(convHeatFL5.pipeSurfaceArea, pi * pipeDiameter2 * lenPipe / (numNodes - 1));
reinit(convHeatFL6.pipeSurfaceArea, pi * pipeDiameter2 * lenPipe / (numNodes - 1));
reinit(convHeatFL7.pipeSurfaceArea, pi * pipeDiameter2 * lenPipe / (numNodes - 1));
reinit(convHeatFL8.pipeSurfaceArea, pi * pipeDiameter2 * lenPipe / (numNodes - 1));
reinit(convHeatFL9.pipeSurfaceArea, pi * pipeDiameter2 * lenPipe / (numNodes - 1));
// El cambio en la geometria del intercambiador modifica la conveccion de calor gas - pared
reinit(convHeatFG1.pipeDiameter, pipeDiameter1);
reinit(convHeatFG2.pipeDiameter, pipeDiameter1);
reinit(convHeatFG3.pipeDiameter, pipeDiameter1);
reinit(convHeatFG4.pipeDiameter, pipeDiameter1);
reinit(convHeatFG5.pipeDiameter, pipeDiameter1);
reinit(convHeatFG6.pipeDiameter, pipeDiameter1);
reinit(convHeatFG7.pipeDiameter, pipeDiameter1);
reinit(convHeatFG8.pipeDiameter, pipeDiameter1);
reinit(convHeatFG9.pipeDiameter, pipeDiameter1);
reinit(convHeatFG1.pipeSection, pi * (pipeDiameter1/2)^ 2);
reinit(convHeatFG2.pipeSection, pi * (pipeDiameter1/2)^ 2);
reinit(convHeatFG3.pipeSection, pi * (pipeDiameter1/2)^ 2);
reinit(convHeatFG4.pipeSection, pi * (pipeDiameter1/2)^ 2);
reinit(convHeatFG5.pipeSection, pi * (pipeDiameter1/2)^ 2);
reinit(convHeatFG6.pipeSection, pi * (pipeDiameter1/2)^ 2);
reinit(convHeatFG7.pipeSection, pi * (pipeDiameter1/2)^ 2);
reinit(convHeatFG8.pipeSection, pi * (pipeDiameter1/2)^ 2);
reinit(convHeatFG9.pipeSection, pi * (pipeDiameter1/2)^ 2);
reinit(convHeatFG1.pipeSurfaceArea, pi * pipeDiameter1 * lenPipe / (numNodes - 1));
reinit(convHeatFG2.pipeSurfaceArea, pi * pipeDiameter1 * lenPipe / (numNodes - 1));
reinit(convHeatFG3.pipeSurfaceArea, pi * pipeDiameter1 * lenPipe / (numNodes - 1));
reinit(convHeatFG4.pipeSurfaceArea, pi * pipeDiameter1 * lenPipe / (numNodes - 1));
reinit(convHeatFG5.pipeSurfaceArea, pi * pipeDiameter1 * lenPipe / (numNodes - 1));
reinit(convHeatFG6.pipeSurfaceArea, pi * pipeDiameter1 * lenPipe / (numNodes - 1));
reinit(convHeatFG7.pipeSurfaceArea, pi * pipeDiameter1 * lenPipe / (numNodes - 1));
reinit(convHeatFG8.pipeSurfaceArea, pi * pipeDiameter1 * lenPipe / (numNodes - 1));
reinit(convHeatFG9.pipeSurfaceArea, pi * pipeDiameter1 * lenPipe / (numNodes - 1));
end when;
// Interactive change of the input variables
// -----------------------------------------
when CKvar > 0.5 and pre(CKvarIs0) or CKvar
< 0.5 and not pre(CKvarIs0) then
CKvarIs0 =CKvar < 0.5;
reinit(pumpLCntrl.totalMassFlowSP,Ivar[1]);
reinit(sourceL1Cntrl.totalMassFlowSP,Ivar[1]);
reinit(sourceL2Cntrl.totalMassFlowSP,Ivar[1]);
reinit(sourceL1Cntrl.tempFlowSP,Ivar[2]);
reinit(sourceL2Cntrl.tempFlowSP,Ivar[2]);
reinit(pumpGCntrl.totalMolFlowSP,Ivar[3]);
reinit(sourceG1Cntrl.totalMolFlowSP,Ivar[3]);
reinit(sourceG2Cntrl.totalMolFlowSP,Ivar[3]);
reinit(sourceG1Cntrl.tempFlowSP,Ivar[4]);
reinit(sourceG2Cntrl.tempFlowSP,Ivar[4]);
reinit(sourceG1Cntrl.molFracCO2SP,Ivar[5]);
reinit(sourceG2Cntrl.molFracCO2SP,Ivar[5]);
end when;
// Interactive change of the state variables
// -----------------------------------------
when CKstate > 0.5 and pre(CKstateIs0) or CKstate
< 0.5 and not pre(CKstateIs0) then
CKstateIs0 =CKstate < 0.5;
// Temperatura del liquido
reinit(volCntrlLiq1.liquid.tempL,Istate[1]);
reinit(volCntrlLiq2.liquid.tempL,Istate[2]);
reinit(volCntrlLiq3.liquid.tempL,Istate[3]);
reinit(volCntrlLiq4.liquid.tempL,Istate[4]);
reinit(volCntrlLiq5.liquid.tempL,Istate[5]);
reinit(volCntrlLiq6.liquid.tempL,Istate[6]);
reinit(volCntrlLiq7.liquid.tempL,Istate[7]);
reinit(volCntrlLiq8.liquid.tempL,Istate[8]);
reinit(volCntrlLiq9.liquid.tempL,Istate[9]);
reinit(volCntrlLiq10.liquid.tempL,Istate[10]);
// Temperatura de la mezcla gaseosa
reinit(volCntrlGas1.semiPerfGas.tempG,Istate[11]);
reinit(volCntrlGas2.semiPerfGas.tempG,Istate[12]);
reinit(volCntrlGas3.semiPerfGas.tempG,Istate[13]);
reinit(volCntrlGas4.semiPerfGas.tempG,Istate[14]);
reinit(volCntrlGas5.semiPerfGas.tempG,Istate[15]);
reinit(volCntrlGas6.semiPerfGas.tempG,Istate[16]);
reinit(volCntrlGas7.semiPerfGas.tempG,Istate[17]);
reinit(volCntrlGas8.semiPerfGas.tempG,Istate[18]);
reinit(volCntrlGas9.semiPerfGas.tempG,Istate[19]);
reinit(volCntrlGas10.semiPerfGas.tempG,Istate[20]);
// Temperatura de la pared
reinit(pipeWall1.temp,Istate[21]);
reinit(pipeWall2.temp,Istate[22]);
reinit(pipeWall3.temp,Istate[23]);
reinit(pipeWall4.temp,Istate[24]);
reinit(pipeWall5.temp,Istate[25]);
reinit(pipeWall6.temp,Istate[26]);
reinit(pipeWall7.temp,Istate[27]);
reinit(pipeWall8.temp,Istate[28]);
reinit(pipeWall9.temp,Istate[29]);
// Istate.signal[30] es la presion del gas, que es igual en todos los volumenes de control
// Istate.signal[31] es la fraccion molar de CO2
// Numero de moles de CO2 y SO2 en los volumenes de control,
// calculados a partir de Istate.signal[30], Istate.signal[30] y la correspondiente temperatura en el volumen de control
reinit(volCntrlGas1.semiPerfGas.molG[1],
0.5*Istate[31] *Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[11]));
reinit(volCntrlGas1.semiPerfGas.molG[2],
0.5*(1-Istate[31]) *Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[11]));
reinit(volCntrlGas2.semiPerfGas.molG[1],Istate[31]
*Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[12]));
reinit(volCntrlGas2.semiPerfGas.molG[2],
(1-Istate[31]) *Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[12]));
reinit(volCntrlGas3.semiPerfGas.molG[1],Istate[31]
*Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[13]));
reinit(volCntrlGas3.semiPerfGas.molG[2],
(1-Istate[31]) *Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[13]));
reinit(volCntrlGas4.semiPerfGas.molG[1],Istate[31]
*Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[14]));
reinit(volCntrlGas4.semiPerfGas.molG[2],
(1-Istate[31]) *Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[14]));
reinit(volCntrlGas5.semiPerfGas.molG[1],Istate[31]
*Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[15]));
reinit(volCntrlGas5.semiPerfGas.molG[2],
(1-Istate[31]) *Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[15]));
reinit(volCntrlGas6.semiPerfGas.molG[1],Istate[31]
*Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[16]));
reinit(volCntrlGas6.semiPerfGas.molG[2],
(1-Istate[31]) *Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[16]));
reinit(volCntrlGas7.semiPerfGas.molG[1],Istate[31]
*Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[17]));
reinit(volCntrlGas7.semiPerfGas.molG[2],
(1-Istate[31]) *Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[17]));
reinit(volCntrlGas8.semiPerfGas.molG[1],Istate[31]
*Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[18]));
reinit(volCntrlGas8.semiPerfGas.molG[2],
(1-Istate[31]) *Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[18]));
reinit(volCntrlGas9.semiPerfGas.molG[1],Istate[31]
*Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[19]));
reinit(volCntrlGas9.semiPerfGas.molG[2],
(1-Istate[31]) *Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[19]));
reinit(volCntrlGas10.semiPerfGas.molG[1],
0.5*Istate[31] *Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[20]));
reinit(volCntrlGas10.semiPerfGas.molG[2],
0.5*(1-Istate[31]) *Istate[30] * pi * (pipeDiameter1/2)^ 2 * lenPipe / ( (numNodes - 1) * perfGasConst *Istate[20]));
end when;
// Output variables
// ----------------
O = {
tempLiq[1], tempLiq[2], tempLiq[3], tempLiq[4], tempLiq[5],
tempLiq[6], tempLiq[7], tempLiq[8], tempLiq[9], tempLiq[10],
tempGas[1], tempGas[2], tempGas[3], tempGas[4], tempGas[5],
tempGas[6], tempGas[7], tempGas[8], tempGas[9], tempGas[10],
tempWall[1], tempWall[2], tempWall[3], tempWall[4], tempWall[5],
tempWall[6], tempWall[7], tempWall[8], tempWall[9],
massFlowLiq[1],
molFlowGas[1], molFlowGas[2],
tempLiqFlowSourceL1,
tempLiqFlowSourceL2,
tempGasFlowSourceG1,
tempGasFlowSourceG2};
end DoublePipeHeatExchangerInteractive;