source: issm/trunk-jpl/test/NightlyRun/test1303.m@ 13663

Last change on this file since 13663 was 13663, checked in by Mathieu Morlighem, 12 years ago

CHG: cosmetics on matlab file (model -> model(); Enum -> Enum())

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