[19049] | 1 | %Test Name: ThermalConduction
|
---|
[5046] | 2 | % This file can be run to check that the conduction is correctly modeled.
|
---|
| 3 | % There is no velocity (no advection) the only thermal boundary conditions are an imposed temperature
|
---|
| 4 | % at the lower and upper surface. The result must be a linear temperature from the upper to the lower
|
---|
| 5 | % surface. if it is not the case, something is thermal modeling has been changed...
|
---|
[5606] | 6 | printingflag=false;
|
---|
[5046] | 7 |
|
---|
[13663] | 8 | md=model();
|
---|
[13670] | 9 | md=triangle(md,'../Exp/Square.exp',100000.);
|
---|
[9641] | 10 | md=setmask(md,'all','');
|
---|
[5046] | 11 | md=parameterize(md,'../Par/SquareThermal.par');
|
---|
[13671] | 12 | md=extrude(md,11,2.);
|
---|
[15565] | 13 | md=setflowequation(md,'HO','all');
|
---|
[14102] | 14 |
|
---|
[17610] | 15 | pos1=find(md.mesh.elementonbase); md.thermal.spctemperature(md.mesh.elements(pos1,1:3))=10.;
|
---|
[14102] | 16 | pos2=find(md.mesh.elementonsurface); md.thermal.spctemperature(md.mesh.elements(pos2,4:6))=0.;
|
---|
[9725] | 17 | md.initialization.pressure=zeros(md.mesh.numberofvertices,1);
|
---|
[5046] | 18 |
|
---|
| 19 | %analytical results
|
---|
| 20 | %d2T/dz2=0 T(bed)=10 T(surface)=0 => T=0*(z-bed)/thickness+10*(surface-z)/thickness
|
---|
| 21 | %each layer of the 3d mesh must have a constant value
|
---|
[14102] | 22 | md.initialization.temperature=10.*(md.geometry.surface-md.mesh.z)./md.geometry.thickness;
|
---|
[5046] | 23 |
|
---|
[14102] | 24 | %modeled results
|
---|
[8630] | 25 | md.cluster=generic('name',oshostname(),'np',2);
|
---|
[21049] | 26 | md=solve(md,'ThermalSolution');
|
---|
[5046] | 27 |
|
---|
| 28 | %plot results
|
---|
[11024] | 29 | comp_temp=md.results.ThermalSolution.Temperature;
|
---|
[14102] | 30 | relative=abs((comp_temp-md.initialization.temperature)./md.initialization.temperature)*100.;
|
---|
| 31 | relative(find(comp_temp==md.initialization.temperature))=0.;
|
---|
[9850] | 32 | plotmodel(md,'data',comp_temp,'title','Modeled temperature [K]','data',md.initialization.temperature,'view',3,...
|
---|
[9684] | 33 | 'title','Analytical temperature [K]','view',3,'data',comp_temp-md.initialization.temperature,...
|
---|
[5271] | 34 | 'title','Absolute error [K]','view',3,'data',relative,'title','Relative error [%]','view',3,...
|
---|
[5422] | 35 | 'figposition','mathieu','FontSize#all',20)
|
---|
[14102] | 36 | if printingflag,
|
---|
[5422] | 37 | set(gcf,'Color','w')
|
---|
| 38 | printmodel('thermalconduction','png','margin','on','marginsize',25,'frame','off','resolution',0.7,'hardcopy','off');
|
---|
[6088] | 39 | system(['mv thermalconduction.png ' ISSM_DIR '/website/doc_pdf/validation/Images/Thermal ']);
|
---|
[5422] | 40 | end
|
---|
[5098] | 41 |
|
---|
| 42 | %Fields and tolerances to track changes
|
---|
| 43 | field_names ={'ConductionTemperature'};
|
---|
| 44 | field_tolerances={1e-13};
|
---|
| 45 | field_values ={comp_temp};
|
---|