# Transient Heat Transfer | Simple One-Layer Wall

 Register Blogs Members List Search Today's Posts Mark Forums Read January 14, 2022, 03:37 Transient Heat Transfer | Simple One-Layer Wall #1 Member   Khan Join Date: Jul 2018 Posts: 35 Rep Power: 5 Hello All, I try to build a transient heat transfer model for a simple one-layer wall by use of the Resistance-Capacitance (RC) approach. However, the transient temperature distribution shows weird numbers in time. Would you please check my approach and code? Heat balance for each capacitance can be written as: Forward-Euler Discretization (one-dimensional) gives: At each time step this calculation procedure is run: Here is the Python code to calculate the temperature distribution in time: Code: ```import numpy as np """ Input Parameters """ # Wall height_w = 3 # [m] height of the wall wide_w = 5 # [m] wide of the wall thick_w = 0.3 # [m] thickness of the wall volume_w = height_w * wide_w * thick_w # [m3] volume of the wall area_w= height_w * wide_w # [m2] wall area # Room deep_r = 4 # [m] deepness of room volume_r = height_w * wide_w * deep_r # [m3] volume of the room air # Initial Temperature T_in = 20 # [°C] indoor temperature T_out = 2 # [°C] outdoor temperature # Thermal h_in = 8 # [W/m2K] heat transfer coefficient (indoor) h_out = 15 # [W/m2K] heat transfer coefficient (outdoor) # see: Balaji NC et al. Thermal performance of the building walls k_w = 0.811 # [W/mK] thermal conductivity (brick) rho_w = 1820 # [kg/m3] density (brick) Cp_w = 880 # [J/kgK] specific heat capacity (brick) # Air rho_a = 1.204 # [kg/m3] density (air at 20 °C) Cp_a = 1006 # [J/kgK] specific heat capacity (air at 20 °C) """ Preliminary Calculations """ delta_t = 1 # [s] C_a = rho_a * Cp_a * volume_r # [J/K] C_w = rho_w * Cp_w * volume_w # [J/K] R_in = 1 / (h_in * area_w) # [K/W] R_out = 1 / (h_out * area_w) # [K/W] R_w = thick_w / (k_w * area_w) # [K/W] # print('R_in = ',R_in) # print('R_out = ',R_out) # print('R_w = ',R_w) """ Numeric Constants """ A = np.zeros( (4, 4) ) A=1+delta_t/(C_a*R_in) A=-delta_t/(C_a*R_in) A=4*delta_t/(C_w*R_in) A=1-4*delta_t/C_w*(1/R_in+2/R_w) A=8*delta_t/(C_w*R_w) A=4*delta_t/(C_w*R_w) A=1-2*delta_t/C_w*(2/R_w+2/R_w) A=4*delta_t/(C_w*R_w) A=8*delta_t/(C_w*R_w) A=1-4*delta_t/C_w*(2/R_w+1/R_out) B = np.zeros((4,1)) B=4*delta_t*T_out/(C_w*R_out) """ Numerical Simulation """ T_init=np.ones((4,1))*15 for i in range(1): T=np.matmul(A,T_init)+B T_init=T``` Last edited by HumanistEngineer; January 15, 2022 at 05:21.   January 15, 2022, 05:54 #2 Member   Khan Join Date: Jul 2018 Posts: 35 Rep Power: 5 I found the error: The first heat balance shall be replaced with: C_in*(dT_in/dt)=- (T_in - T_w1) / R_in  Thread Tools Search this Thread Show Printable Version Email this Page Search this Thread: Advanced Search Display Modes Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules Similar Threads Thread Thread Starter Forum Replies Last Post jimmy871013 FLUENT 6 April 27, 2018 02:00 groonm CFX 0 September 12, 2016 10:20 MichaelK CFX 12 September 1, 2016 05:15 hinca CFX 15 January 26, 2014 17:11 rogbrito CFX 1 January 29, 2012 17:48

All times are GMT -4. The time now is 13:19.