TITLE 'Scambio di calore in un recipiente agitato' COORDINATES cartesian2 { 2D - x,y } VARIABLES vx vy p Temp SELECT !errlim=1e-3 DEFINITIONS Lx=0.1 Ly=0.1 d=Lx/3 H=d/20 { geometria del sistema } vo=0.005 { velocità di agitazione } Ti=350 Tpl=300 { temperature } visc=1e-3 dens=1e3 cond=0.6 cp=4186 { proprietà dell'acqua } rcp=dens*cp alfa=cond/rcp v=vector (vx,vy) vm=magnitude(v) Lc=Lx { lunghezza caratteristica } Re=dens*vo*Lc/visc ! in letteratura la velocità utilizzata è quella della girante Pr=visc*cp/cond Tmedia=VOL_INTEGRAL(Temp)/(Lx*Ly) hcal_m=min(-Ly*rcp*LN((Tmedia-Tpl)/(Ti-Tpl))/t,1000) Nu=hcal_m*Lc/cond flux_y=-cond*dy(Temp) flux_x=-cond*dx(Temp) flux_pl=LINE_INTEGRAL(flux_y,'pelo libero')/Lx hcal2=flux_pl/(Tmedia-Tpl) hcal2_m=if TIME_INTEGRAL(hcal2)/t=0 then 1000 else TIME_INTEGRAL(hcal2)/t tc_av=Lx/line_integral(vm, 'pelo libero' ) INITIAL VALUES Temp=Ti EQUATIONS vx: dx(p)-visc*div(grad(vx)) =-dens*(vx*dx(vx)+vy*dy(vx)) vy: dy(p)-visc*div(grad(vy))=-dens*(vx*dx(vy)+vy*dy(vy)) p: del2(p)-1e5*div(v)=-2*dens*(dx(vy)*dy(vx)-dx(vx)*dy(vy)) Temp: rcp*dt(Temp)-cond*del2(Temp)+rcp*(vx*dx(Temp)+vy*dy(Temp))=0 BOUNDARIES region 1 'recipiente' mesh_density=Lx/100 start (0, 0) value(vx)=0 value(vy)=0 natural(Temp)=0 natural(p)=0 line to (Lx,0) { parete inferiore, adiabatica } value(vx)=0 value(vy)=0 natural(Temp)=0 natural(p)=0 line to (Lx,Ly) { parete di destra, adiabatica } natural(vx)=0 value(vy)=0 value(Temp)=Tpl value(p)=0 line to (0,Ly) { pelo libero a T fissata } value(vx)=0 value(vy)=0 natural(Temp)=0 natural(p)=0 line to close { parete di sinistra, adiabatica } feature start 'pelo libero' (0,Ly) line to (Lx,Ly) region 2 'agitazione' start (Lx/2-d/2,Ly/2) value(vx)=0 value(vy)=-vo natural(Temp)=0 natural(p)=0 line to (Lx/2+d/2,Ly/2) line to (Lx/2+d/2,Ly/2-H) line to (Lx/2-d/2,Ly/2-H) line to close TIME 0 TO 1500000 HALT (GLOBALMAX(Temp) -Tpl)<1 MONITORS !for t = 0 by 600 to 1500000 for cycle=1 vector (v) zoom (0,0,Lx,Lx) contour (vm) zoom (0,0,Lx,Ly) contour (Temp) surface(Temp) FIXED RANGE ( Tpl, Ti ) PLOTS !for t = 0 by 600 to 1500000 for cycle=1 contour (Temp) painted surface(p) vector (v) zoom (0,0,Lx,Ly) elevation(vx) from (0,Ly) to (Lx,Ly) as "Velocità del pelo libero" elevation (Temp) from (0,Ly/2) to (Lx,Ly/2) as "Temperatura lungo x al centro del recipiente" FIXED RANGE ( Tpl, Ti ) !export format "#x#r,#i" file="T lungo x.txt" elevation (Temp) from (Lx/2,0) to (Lx/2,Ly) as "Temperatura lungo y al centro del recipiente" FIXED RANGE ( Tpl, Ti ) !export format "#y#r,#i" file="T lungo y.txt" elevation(flux_y) from (0,Ly) to (Lx,Ly) as "Flusso al pelo libero" vector(flux_x, flux_y) as "Heat flow" !surface(vx) !surface(vy) SUMMARY report(t) as 'Tempo' report(Tmedia) as "Temperatura media" report(alfa) as "Diffusività termica" report(hcal_m) as "Coefficiente di scambio termico (1)" report(hcal2_m) as "Coefficiente di scambio medio (2)" !report(Re) as 'Numero di Reynolds' !report(Pr) as 'Numero di Prandtl' !report (Nu) as 'Numero di Nusselt medio' report(flux_pl) as 'Flusso medio al pelo libero' report(tc_av) as 'Tempo medio di contatto' HISTORIES history(Tmedia) versus (t) as "Temperatura media" !export format "#t#r,#i" file="T media.txt" { diagramma la temperatura media contro il tempo e ne salva i dati } history(Temp) at (0,Ly/2) (Lx/2,0) (Lx/2,Ly/2) (Lx/2,Ly/2-d) (Lx,Ly/2) as "Temperatura in diversi punti" !export format "#t#r,#i" file="T interne.txt" { diagramma la temperatura in diversi punti del recipiente contro il tempo e ne salva i dati } history(hcal2) versus (t) as "Coefficiente di scambio istantaneo (2)" linlog { diagramma il coefficiente di scambio istantaneo contro il tempo } history(hcal_m,hcal2_m) versus (t) as "Coefficiente di scambio medio" linlog !export format "#t#r,#i" file="h.txt" { diagramma i coefficienti di scambio medi contro il tempo per confrontarli e ne salva i dati } END