internalHeatSource for cylindrical geometry
3 次查看(过去 30 天)
显示 更早的评论
Dear all,
I have the following problem using the Matlab PDE toolbox for thermal analysis:
If I call the Matlab function internalHeatSource for different segments it looks like as if the latest call overwrites the previous calls.
Problem: I have a solid rod inside a solid cylindrical shell separated with a layer of gas. All three segments have body heating proportional to their density (gamma heating). The shell is cooled with water from outside. The geometry has a cylindrical symmetry. I’m looking for a steady state solution.
The boundary conditions at the axis of symmetry (y=0), top and bottom (x=x1,x2) have thermal flux zero. I provide the Matalab code. At the end of the code the exact analytical solution of the problem is calculated and compared to the fem results.
Considering that the segments have different heatings I have to call internalHeatSourceat least two times. It looks like that the latest call of the Matlab function internalHeatSource overwrites the previous calls.
Case 1:
rho_solid = 1.e3; % kg/m3
rho_gas = 1.; % kg/m3
The fem calculates higher central temperature as if in the calculations it uses rho_gas = 1.e3.
Case 2:
Use the same heating value for solid and gas segments
rho_solid = 1.e3; % kg/m3
rho_gas = 1.e3; % kg/m3
Both solutions, fem and analytical are identical.
Case 3:
Use the correct values for the densities
rho_solid = 1.e3; % kg/m3
rho_gas = 1.; % kg/m3
but swap the sequence of the internalHeatSource calls: Let the call for segment 2 (with rho_gas = 1.;) be the last in the code.
The central temperature produced by fem is incredibly low as if for all segments the gas density is used.
Could you please help me with finding a solution for this strange behavior.
Thank you in advance,
Alexander
0 个评论
回答(2 个)
Ravi Kumar
2020-3-5
Having an axisymmetric analsysis, which is not supported yet, would simplify your setup.Here is an alternative approach which might solve your problem:
Replace:
internalHeatSource(thermalmodel,f_gas,'Face',2);
internalHeatSource(thermalmodel,f_solid,'Face',1);
internalHeatSource(thermalmodel,f_solid,'Face',3);
with a single call:
hsFcn = @(region,state) assignHS(region,state,f_gas, f_solid);
internalHeatSource(thermalmodel,hsFcn)
where you define assignHS to assigns different heat source values based on the subdmains as:
function q = assignHS(region,state,f_gas, f_solid)
if region.subdomain == 2
q = f_gas(region,state);
else
q = f_solid(region,state);
end
end
You can past assignHS function at the end of your script or as a seperate file. The way you have the setup should also work, it might be missing to detect the variation in value of heat source based on the query. I will investigate this further. Sorry for the inconvenince this has caused you.
Regards,
Ravi
2 个评论
Ravi Kumar
2020-3-7
Hi Alexander,
I did notice the difference. The mesh is highly resolved, so I would agree with you the differece is large to be attributed for numerical error. When you say exact solution, do you have a reference that I can read and understand the code that you have used to compte the exact solution at the end of the code you shared.
Regards,
Ravi
Alexander
2020-3-9
3 个评论
Ravi Kumar
2020-3-10
Hi Alexander,
Thanks for the additional validation information. I will go through it and get back to you.
Regards,
Ravi
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!