CONTINUOUS_MODEL RCWall ABSTRACT "WALL model based on RC network. Auto select 2 or 3 nodes. 1D heat flow, TQ interfaces on both sides. Arbitrary number of material layers are combined into three (or sometimes two) nodes by optimizing parameters Ca,Cb,Cc,Ra,Rb,R1,R2. Light walls will get Cc = 0. Optimization is done by subroutine 'RcOpt' [Akander ??]. Sum of deviations in responses to harmonic driving functions, with periods 1,2,..96 h, are minimized. QA-> <-QB Tpa Ta Tc Tb Tpb ---- ----- ---- ---- o--| Ra |----o----| R1 |-----o----| R2 |----o----| Rb |--o ---- | ----- | ---- | ---- SurfA | | | SurfB | | | --- --- --- --- Ca --- Cc --- Cb | | | 981124 MV ra and rb resistances are checked as well. cp parameter is changed HeatCapM 980830 AB Add protection against negative capacities (should be in RCOpt, chk w Jan Akander). 980128 AB Check on [near] negative resistances. 971111 MV In the 2 node case R1 and R2 are represented by the sum of them. It is handled in the RCOPT fortran code. Parameter name cp reintroduced. 971023 AB RCWALL, RCOPT Select 2 or 3 nodes for T[nNode] " EQUATIONS /* Capacities - dynamic equations */ Ca * A * T'[1] = Qa + A/R1 * (T[2] - T[1]); Cb * A * T'[nNode] = Qb + A/R2 * (T[nNode-1] - T[nNode]); FOR i=2, (nNode-1) Cc * A * T'[i] = A/R1 * (T[i-1]-T[i]) + A/R2 * (T[i+1]-T[i]); END_FOR; /* Resistances - algebraic equations */ Qa = A * (Tpa - T[1]) / Ra; Qb = A * (Tpb - T[nNode]) / Rb; LINKS /* type name variables */ TQ Term_a Tpa, POS_IN Qa ; TQ Term_b Tpb, POS_IN Qb ; VARIABLES /* type name role def min max description */ Temp Tpa OUT 27.3 ABS_ZERO BIG "Temp at surface A" Temp Tpb OUT 24.2 ABS_ZERO BIG "Temp at surface B" Temp T[nNode] OUT 24.0 ABS_ZERO BIG "Temp at capacity [i]" HeatFlux Qa IN -6 -BIG BIG "Influx at surface A" HeatFlux Qb IN -146 -BIG BIG "Influx at surface B" MODEL_PARAMETERS /* type name role def min max description */ INT n SMP 1 1 BIGINT "Number of wall layers" INT nNode CMP 2 2 3 "Number of nodes" PARAMETERS /* type name role def min max description */ Area A S_P 5.3 SMALL BIG "wall area" Length l[n] S_P 0.01 SMALL BIG "layer thickness" HeatCondL lambda[n] S_P 0.08 SMALL BIG "layer heat conductivity" Density rho[n] S_P 1800 SMALL BIG "layer density" HeatCapM cp[n] S_P 790 SMALL BIG "layer spec heat" /* derived parameters */ HeatCapA Ca C_P 24800 SMALL BIG "optimal heat cap side a" HeatCapA Cb C_P 24800 SMALL BIG "optimal heat cap side b" HeatCapA Cc C_P 102560 SMALL BIG "optimal heat cap center" HeatResA R1 C_P 0.81 SMALL BIG "optimal res between nodes a,c" HeatResA R2 C_P 0.81 SMALL BIG "optimal res between nodes c,b" HeatResA Ra C_P 0.03 SMALL BIG "optimal resistance side a" HeatResA Rb C_P 0.03 SMALL BIG "optimal resistance side b" PARAMETER_PROCESSING /* Create 2- or 3-node network (nNode). When the wall is light, only two nodes are needed, and Cc is set to zero. */ call rcopt(n,l[1],lambda[1],rho[1],cp[1], Ca,Cb,Cc,Ra,Rb,R1,R2, nNode); if r1 < 0.0001 or r2 < 0.0001 or ra < 0.0001 or rb < 0.0001 then call nmf_error("resistances too small or negative"); end_if; if ca < 0.0001 or cb < 0.0001 or cc < 0.0001 and nNode == 3 then call nmf_error("capacities too small or negative"); end_if; END_MODEL