# Modelling 1-D radiation in small gaps (between wall and its shadow thread)

 Client wants to model radiative h.t. between two solids separated by small gap.DESCRIPTION============This solution contains a UDF which gives the user a value wall thickness (assumed Aluminum material) to simulate radiative heat exchange.The process is iterative, but usually only takes 2-4 iterations to converge.LIMITATIONS===========Can only be applied to one face/shadow thread pairAssumes value of effective radiative heat transfer coefficient is constant on entire face and is based on face thread mean temperatures.CONTENTS==========This SOLUTION contains 1 UDF and 1 Scheme file!BACKGROUND=============Normally, the gap has a material which is modeled by ordinary conduction:Q = k (T2 - T1) / dxFor radiation,Q = sigma (T2^4 - T1^4) = sigma (T2^2 + T1^2) * (T2^2 - T1^2)= sigma (T2^2 + T1^2) * (T2 + T1) * (T2 - T1)So, if we let...k / dx = sigma (T2^2 + T1^2) * (T2 + T1),then we will use the conduction model to simulate radiative transfer! The catch is that the conduction itself is a function of temperature, so we have to recomputethe coefficients each iteration. Fortunately, this process only takes one or two iterations.Instead of modifying k/dx, we let the material properties determine k, and modify only dx. From the above equation,dx = k / [ sigma * (T2^2 + T1^2) * (T2 + T1) ]EXECUTION==========1. Compile UDF2. Read case/data3. Read Scheme file "rad_gap.scm"4. Enter face/thread IDS of the wall and its shadow in the GUI panel under DEFINE...5. Hook the DEFINE_ADJUST function6. Iterate....The define adjust will inform the user to adjust the thickness of the 1-D wall between the shadow (but doesn't actually do it!) to simulate radiation heat transfer.NOTE1. Surface emissivities are hardwired into the UDF2. Surface temperatures in the coefficient are based on mean surface temps of the thread./*********//* UDF *//*********/#include "udf.h"#include "models.h"real mean_temp(Thread* t);#define eps1 0.02#define eps2 0.02#define k 202.4 /* Thermal conductivity of aluminum (default wall material) */DEFINE_ADJUST(thermal_rad_gap,d){ int id1, id2; Thread *t1, *t2; real temp1, temp2, koverdx, dx; id1 = RP_Get_Integer("zone-1-rad-gap"); id2 = RP_Get_Integer("zone-2-rad-gap"); t1 = Lookup_Thread(d,id1); t2 = Lookup_Thread(d,id2); if (sg_temperature) { if (FACE_THREAD_P(t1) & FACE_THREAD_P(t2)) { /* Integrate temperatures */ temp1 = mean_temp(t1); temp2 = mean_temp(t2); /* Print */ Message0("T1_avg = %10.3en", temp1); Message0("T2_avg = %10.3en", temp2); koverdx = SIGMA_SBC * (temp1 + temp2) * (temp1*temp1 + temp2*temp2) / ((1-eps1)/eps1 + (1-eps2)/eps2); /* Message0("keffrad/dx = %10.3en", koverdx); */ dx = k / koverdx; Message0("Set thickness in zones %d and %d to = %10.3en", id1, id2, dx); } /* else */ { Message0("Zone ids are not both face zonesn"); } } else { Message0("Energy eqn must be on.n"); } return;}real mean_temp(Thread* t){ face_t f; real A[ND_ND], Amag, mean; real sumt, suma; sumt = suma = 0.0; begin_f_loop(f,t) { F_AREA(A,f,t); Amag = NV_MAG(A); sumt += F_T(f,t) * Amag; suma += Amag; } end_f_loop(f,t); /* Parallel versions */#if RP_NODE sumt = PRF_GRSUM1(sumt); suma = PRF_GRSUM1(suma);#endif mean = sumt/suma; return mean;}/**** END OF UDF *****/;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SCHEME FILE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;(define (make-new-rpvar name default type) (if (not (rp-var-object name)) (rp-var-define name default type #f)));;;; Create rpvars for udf, assign initial (ie: default) values;; types: real, boolean, integer, thread-list;; () is empty list, #f is false (off);;(make-new-rpvar 'zone-1-rad-gap 0 'integer)(make-new-rpvar 'zone-2-rad-gap 0 'integer);;;; Create a panel for the udf;;(define gui-define-output-data-panel ;;; "panel" is a variable name ;;; panel #f - no panel made yet (let ((panel #f) ;;; declare variables - assign values later (mybox) (zone-1-rad-gap) (zone-2-rad-gap) ) ;;; ;;; Function which is called when panel is opened ;;; sets panel variables to values in make-new-rpvar section ;;; default: all options off, no surfaces selected ;;; (define (update-cb . args) (cx-set-real-entry zone-1-rad-gap (rpgetvar 'zone-1-rad-gap)) (cx-set-real-entry zone-2-rad-gap (rpgetvar 'zone-2-rad-gap)) ) ;;; ;;; Function which is called when OK button is hit. ;;; assigns variable values that were set in panel after clicking "ok" ;;; (define (apply-cb . args) (rpsetvar 'zone-1-rad-gap (cx-show-real-entry zone-1-rad-gap)) (rpsetvar 'zone-2-rad-gap (cx-show-real-entry zone-2-rad-gap)) ) (lambda args ;;; if panel does not exist, make panel (if (not panel) ;; create panel (let ((table)) (set! panel (cx-create-panel "Custom Variables Panel" apply-cb update-cb)) ;; create table w/o title in panel to enable row by column format (set! table (cx-create-table panel "" 'border #f 'below 0 'right-of 0)) ;;; Create Custom Variable input. (set! mybox (cx-create-table table "Custom Variables" 'border #t 'row 0)) (set! zone-1-rad-gap (cx-create-real-entry mybox "zone-1-rad-gap" 'row 0 'col 0)) (set! zone-2-rad-gap (cx-create-real-entry mybox "zone-2-rad-gap" 'row 1 'col 0)) ) ) ;; tell solver to display the panel (cx-show-panel panel) ) ));;;; Add new panel to end of User-Defined menu.;; no need to modify here except panel name and menu location;;(cx-add-item "Define" "Radiation Gap Boundary Zones..." #U #f cx-client? gui-define-output-data-panel);;;;;;; END OF SCHEME FILE

 No comments yet. Be the first to add a comment!