|
HeaterTI |
Top Previous Next |
|
{ HEATERTI.PDE } {
This example shows the use of a GLOBAL VARIABLE in a control application. We wish to find the required power input to a heater, such that the resulting average temperature over the domain is a specified value.
Notice that the equation defining power is a time-relaxation which drives the power by the deviation of the average temperature from the goal. The time variable is fictitious, and has no meaning here except as a control for the relaxation process.
This problem is a modification of HeaterSSI.pde, showing the use of time-dependent scalar equations. Compare the result to that of HeaterSSI.pde.
}
TITLE "Time-dependent Heater test"
VARIABLES temp { The temperature field }
global variables power { a single value for input power }
DEFINITIONS setpoint=700 { the desired average temperature } skintemp=325 { fixed outer boundary temperature } k=1 { conductivity } heat=0 { the heat function for the temperature. it is non-zero only in the heater region }
{ tc=val(temp,0,0) -- an alternative control method unused here }
tc=integral(temp)/integral(1) { the control function, average temperature }
INITIAL VALUES temp=setpoint power=100 { initial guess for power }
EQUATIONS temp: div(-k*grad(temp))-heat = 0 { diffusion of temperature field } power: dt(power) = setpoint - tc { single equation defining power }
BOUNDARIES
REGION 1 'Insulation' k=0.1 heat=0 start(-4,-4) value(temp)=skintemp line to (4,-4) to (4,4) to (-4,4) to close
REGION 2 'Heater' k=50 heat = power start(-1,-1) line to (1,-1) to (1,1) to (-1,1) to close
TIME 0 to 100 by 1e-4
PLOTS for cycle=10 contour(temp) report power report tc
HISTORIES History(tc-setpoint) as "TC error" History(power)
end |