CONTINUOUS_MODEL bdfwall ABSTRACT "Version of the fdWall model using own THETA-method integrator. Temperature vector T is declared as A_S's (and Q as LOC's). The fdWall model is a finite differences model of a multi-layer component. The user has to discretize each material layer into (nSubCells) number of cells. The following chain of serially connected thermal resistances and heat capacities is calculated: -->Qa -->Q[1] -->Q[nCells-1] -->Qb Qa Tpa ____ T[1] ____ ____ T[nCells] ____ Tpb --> o--|____|---o---|____|----....---|____|---- o----|____|----o -->Qb R[1] | R[2] R[nCells] | R[nCells+1] = = | | C[1] C[nCells] NOTE: This model can be used instead of RCwall, especially if RCwall fails to fulfill required accuracy. Contrary to RCwall, discretization is in this model performed manually. The following data has to be prepared and quantified prior to input: n = number of material layer in building component. nSubLay(n) = subdivision, i.e number of cells, of each material layer subMode = Subdivision mode: 0 uniform, 1 tighter at the beginning, 2 at the end, 3 at both sides nCells = total number of cells (mass nodes), nCells=sum(nSubLay) nOfRs = number of resistances, always nOfRs=nCells+1 nOfQs = number of heat flows in chain, allways nOfQs=nCells-1 Uses a Fortran subroutine for time integration (Theta-method, theta = 0 => Backward Euler (default), theta = 0.5 => Midpoint method) with predictor-corrector procedure and stepsize control. [Qa[t1], Qb[t1]] = F(Tpa[t0:t1], Tpb[t0:t1]) where Tpa and Tpb are supplied at beginning and end of timestep (t0,t1) and also at beginning of old timestep and interpolated linearly or quadraticly in between depending on current order k of IDA method. " /* date Sgn Comment 010910 PG Non-uniform subdivision (subMode) 010608 PG nOfRs, nOfQs, nWork changed to CMP. Added assertion nCells==sum(nSubLays). changed cp type HeatCap --> HeatCapM 010313 MV Default values of temperatures are changed from 0 to 20 °C 000109 rsc Supplied parameter name nLay changed to n */ EQUATIONS /* get time interval for subroutine's integration */ t1 := time; t0 := t1 - timestep; /* Integrate in subroutine Input : Taoldold, Taold, Tpa, Tboldold, Tbold, Tpb Output: Qanew, Qbnew */ CALL THETA_meth(t0, t1, toldold, Taoldold, Taold, Tpa, Tboldold, Tbold, Tpb, nCells, T[1], work[1], Qanew, Qbnew, A, R[1], C[1], work[nCells+1],work[2*nCells+1],work[3*nCells+1], TOL, THETA, dtstart,Jac_approx); /* Boundary heat flux: Qa = A*(Tpa- T[1])/R[1] ; Qb = A*(T[nCells] - Tpb)/R[nCells+1] ;*/ Qa = Qanew ; Qb = Qbnew ; /* Heat flux between mass nodes */ FOR i = 1,(nOfQs) Q[i] := A*(T[i] - T[i+1]) / R[i+1]; END_FOR; /* Save old time and */ toldold := t0; /* temperatures for interpolation at boundaries */ Taoldold := Taold; Tboldold := Tbold; Taold := Tpa; Tbold := Tpb; LINKS /* type name variables */ TQ Term_a Tpa, POS_IN Qa ; TQ Term_b Tpb, POS_OUT Qb ; VARIABLES /* type name role def min max description */ Temp T[nCells] A_S 20 ABS_ZERO BIG "Temp of mass node" Temp Tpa IN 20 ABS_ZERO BIG "Surf temp on a side" Temp Tpb IN 20 ABS_ZERO BIG "Surf temp on b side" Temp Taold A_S 20 ABS_ZERO BIG "Surf temp on a side" Temp Tbold A_S 20 ABS_ZERO BIG "Surf temp on b side" Temp Taoldold A_S 20 ABS_ZERO BIG "Surf temp on a side" Temp Tboldold A_S 20 ABS_ZERO BIG "Surf temp on b side" HeatFlux Qa OUT 0 -BIG BIG "Inflow at surf of side a" HeatFlux Qb OUT 0 -BIG BIG "Outflow at surf of side b" HeatFlux Qanew LOC 0 -BIG BIG "Inflow at surf of side a" HeatFlux Qbnew LOC 0 -BIG BIG "Outflow at surf of side b" HeatFlux Q[nOfQs] LOC 0 -BIG BIG "Flux between mass nodes" Generic toldold A_S 0 ABS_ZERO BIG "start of old timestep" Generic t0 LOC 0 0 BIG "start of timestep" Generic t1 LOC 0 0 BIG "end of timestep" Generic dtstart A_S 0 0 BIG "timestep in THETA-method" Generic work[nWork] A_S 0 0 BIG "workspace" MODEL_PARAMETERS /* type name role def min max description */ INT n SMP 2 1 BIGINT "Number of material layers" INT nCells SMP 2 1 BIGINT "Number of cells = sum(nSubLay)" INT subMode SMP 0 0 3 "Subdivision mode: 0 uniform, 1 tighter at beginning, 2 at end, 3 at both sides" INT nOfRs CMP 3 2 BIGINT "Number of resistances = nCells+1" INT nOfQs CMP 1 0 BIGINT "Number of internal flows = nCells-1" INT nWork CMP 8 4 BIGINT "Size of workspace = 4 * nCells" PARAMETERS /* type name role def min max description */ Area A S_P 1 SMALL BIG "wall area" Length l[n] S_P 0.15 SMALL BIG "layer thickness" HeatCondL lambda[n] S_P 1.7 SMALL BIG "layer heat conductivity" Density rho[n] S_P 2400 SMALL BIG "layer density" HeatCapM cp[n] S_P 880 SMALL BIG "layer spec heat" Factor nSubLay[n] S_P 2 1 BIG "Number of sublayers (cells) per material layer" factor TOL S_P 0.1 0.001 0.5 "tolerance in THETA-method" factor THETA S_P 0.0 0.0 0.5 "Theta in THETA-method" factor Jac_approx S_P 0.0 0.0 3.0 "Type of Jac approximation: = 0 Jacobian evaluated with one time step = 1 Jacobian evaluated by integration = 2 Approximate diagonal Jacobian = 3 Zero Jacobian" /* derived parameters */ HeatCapA C[nCells] C_P 316800 SMALL BIG "model heat capacities" HeatResA R[nOfRs] C_P 0.044 SMALL BIG "resistance between nodes" PARAMETER_PROCESSING IF nCells != SUM i=1,n NINT(nSubLay[i]) END_SUM THEN CALL NMF_ERROR("nCells is not equal to sum(nSubLay)"); END_IF; call fddisc(n,nSubLay[1],nCells,subMode,l[1],lambda[1],rho[1],cp[1],C[1],R[1]); nOfRs := nCells + 1; nOfQs := nCells - 1; nWork := 4 * nCells; END_MODEL