限元与有限差分法应用实验报告.docx
- 文档编号:8481760
- 上传时间:2023-01-31
- 格式:DOCX
- 页数:25
- 大小:466.19KB
限元与有限差分法应用实验报告.docx
《限元与有限差分法应用实验报告.docx》由会员分享,可在线阅读,更多相关《限元与有限差分法应用实验报告.docx(25页珍藏版)》请在冰豆网上搜索。
限元与有限差分法应用实验报告
华中科技大学
研究生课程考试答题本
考生姓名颜小强
考生学号D*********
系、年级数学与统计学院2016级
类别博一
考试科目有限元法与有限差分法的应用
考试日期2016年10月30日
评分
题号
得分
题号
得分
总分:
评卷人:
注:
1、无评卷人签名试卷无效。
2、必须用钢笔或圆珠笔阅卷,使用红色。
用铅笔阅卷无效。
题
号
回答内容
得分
Q1
Pleasededucethesecond-orderforwarddifference,second-orderbackwarddifferenceandsecond-ordercentraldifferenceof
thendeducetheprecisionof
second-ordercentraldifferencebasedonTaylorseriesexpansion.(10points)
Answer:
(1.1)Second-orderforwarddifferenceformula:
Weknowthatthefirstorderforwarddifferenceformulais:
So,thesecond-orderforwarddifferenceformula:
题
号
回答内容
得分
(1.2)Second-ordercentraldifferenceformula:
Weknowthatthefirstordercentraldifferenceformulais:
So,thesecond-ordercentraldifferenceformula:
\
题
号
回答内容
得分
(1.3)Precisionofsecond-ordercentraldifferenceformula:
Taylorseriesexpansionfor
and
are
(1)
(2)
Addingequation
(1)and
(2)weget
or,
thus,second-ordercentraldifferenceformulahastwo-orderprecision.
题
号
回答内容
得分
Q2
Pleasecombinetheresearchdirectionofyoursubject,illustratethetypicalapplicationofthefinitedifferencemethodinthisresearcharea.(35points)
Answer:
Mymajoristhemathematicalcalculation.Theexactdirectionisthenumericalsolutionofpartialdifferentialequationsanditsapplication.Firstofall,FDMiswidelyusedinthenumericalsolutionofpartialdifferentialequations.
Concreteexampleisasfollow:
Finitedifferencemethodforsolvingboundaryvalueproblems
(exactsolutionis
.).Bystep
,wecangetrectangularsectionandwecanstructuredifferencescheme.
Gridnodeis
.Differenceequationisasfollow:
Boundaryvalueconditionisasfollow:
Successively,Weorder
andsolveitwiththeeliminationmethods.
.Wecanmakealistofexactsolutionsandnumericalsolutions.
题
号
回答内容
得分
Q3
PleasesimulatethetemperaturefieldofanH-shapedcastingusingFDM.
Thegeometricconditionsandinitialconditionsareasfollows:
1)ThematerialoftheH-shapedcastingisZG25,theenvironmenttemperatureis25℃andthemoldmaterialisresinsand;
2)Pouringtemperatureis1560℃;
3)CastingsizesareshowninFigure2andFigure3,themoldthicknessis40mm.
Requirements:
1)Writeoutthe2Dor3Dmathematicalmodelthatdescribesthetemperaturefieldofthecastingcoolingprocess;(10points)
2)DeducetheFDMformatofthemathematicalmodel;(10points)
3)DrawtheFDMgridmap,anddescribeitusingdatastructure;(10points)
4)ProvidethethermalpropertiesthermalpropertiesthermalpropertiesthermalpropertiesparametersofZG25,resinsandandtheair;(10points)
5)Programtosimulatethisphysicalprocess,assumingthecavitywasfilledveryfastandtheinitialtemperatureevenlydistributed.Pleaseprovidethemaincodeoftheprogram.(25points)
6)Howlongdoesittakewhilethehighesttemperatureofthecastingdropsto1450℃?
(10points)
F
igure1:
3DmodeloftheH-shapedcasting
题
号
回答内容
得分
Figure2:
DimensionofH-shapedcasting
Figure3:
A2DsliceoftheH-shapedcasting
Q4
回答内容
Answer:
(3.1)The3Dmathematicalmodelis
WhereTistemperature(K),
isdensity(kg/m3),Cisheatcapacity(J/(kg•K)),
isthermalconductivity(W/(m•K)),Listhelatentheat(J/kg)
Ifwedonottakethelatentheatintoconsideration,thenthelasttermoftheaboveequationshouldbeomitted.
(3.2)WediscretizetheFourierdifferentialequationofheatconductionbasedonFDM.Andtheheatexchangeprocessisshownasfollows.
Thededucingprocess:
Thequantityofheatwhichtheelementihasabsorbedis:
ThequantityofheatflowintoIfromthe6elementadjacenttoitis:
Accordingtothelawofconservationofenergy
Afterrearrangementwegettheexplictschemoftemperatureevolution
(3.3)Hereweintroduceafunctionofflag
WhereZG25wouldbecutintofoursmallpiecestobehandledeasily.
for(i=8;i<=88;i++){
for(j=8;j<=28;j++){
for(k=8;k<=24;k++){
flag[i][j][k]=1;//ZG
}
}
}
for(i=38;i<=58;i++){
for(j=8;j<=28;j++){
for(k=24;k<=100;k++){
flag[i][j][k]=1;//ZG
}
}
}
for(i=8;i<=88;i++){
for(j=8;j<=28;j++){
for(k=100;k<=116;k++){flag[i][j][k]=1;//ZG
}
}
}
for(i=8;i<=88;i++){
for(j=8;j<=28;j++){
for(k=116;k<=132;k++){
if(((i-48.0)*(i-48.0)+(j-18.0)*(j-18.0))<=6.0*6.0)
flag[i][j][k]=1;//ZG
}
}
}
(3.4)ThethermalpropertiesparametersofZG25,resinsandandtheairare:
heat conduct coefficient
density
specific heat
ZG25
27.2
7750
470
sand
0.73
1610
1054.9
air
0.0259
1.205
0.001005
(3.5)Theresultsofthissimulationislistingfollowing:
Ourprogrammaininclude5sectionsbelow:
4invokingfunctionsandthemainfunction
Init()isusedtoinitializevariablessuchastemperatureandthermalpropertiesparameters.
voidinit()
{
for(i=0;i<=NX+1;i++){
for(j=0;j<=NY+1;j++){
for(k=0;k<=NZ+1;k++){
if(flag[i][j][k]==-1){//airlayer
CP[i][j][k]=0.001005;
rho[i][j][k]=1.205;
therm[i][j][k]=0.0259;
tem[i][j][k]=25;
tem_0[i][j][k]=25;
}
if(flag[i][j][k]==1){//ZG
CP[i][j][k]=470;
rho[i][j][k]=7750;
therm[i][j][k]=27.2;
tem[i][j][k]=1560;
tem_0[i][j][k]=1560;
}
if(flag[i][j][k]==0){//sand
CP[i][j][k]=1054.9;
rho[i][j][k]=1610;
therm[i][j][k]=0.73;
tem[i][j][k]=25;
tem_0[i][j][k]=25;
}
}
}
calculate_temperature()isusedtocalculatetheevolutionofthetemperaturefield.
voidcaculate_temperature()
{
doubleTEMPLE,t1,t2,t3,t4,t5,t6;
TEMPLE=0;
Tmax=0;
for(i=1;i<=NX;i++){
for(j=1;j<=NY;j++){
for(k=1;k<=NZ;k++){
if(flag[i][j][k]==1||flag[i][j][k]==0){t1=(tem_0[i+1][j][k]-tem_0[i][j][k])/(dx/(2*therm[i+1][j][k])+dx/(2*therm[i][j][k]));
t2=(tem_0[i-1][j][k]-tem_0[i][j][k])/(dx/(2*therm[i-1][j][k])+dx/(2*therm[i][j][k]));
t3=(tem_0[i][j+1][k]-tem_0[i][j][k])/(dx/(2*therm[i][j+1][k])+dx/(2*therm[i][j][k]));
t4=(tem_0[i][j-1][k]-tem_0[i][j][k])/(dx/(2*therm[i][j-1][k])+dx/(2*therm[i][j][k]));
t5=(tem_0[i][j][k+1]-tem_0[i][j][k])/(dx/(2*therm[i][j][k+1])+dx/(2*therm[i][j][k]));
t6=(tem_0[i][j][k-1]-tem_0[i][j][k])/(dx/(2*therm[i][j][k-1])+dx/(2*therm[i][j][k]));
TEMPLE=dt/rho[i][j][k]/CP[i][j][k]/(dx)*(t1+t2+t3+t4+t5+t6);
tem[i][j][k]=tem_0[i][j][k]+TEMPLE;
if(tem[i][j][k]>1560)printf("x=%d,y=%d\n",i,j);
if(tem[i][j][k]>Tmax)
Tmax=tem[i][j][k];
}}}
}
for(i=1;i<=NX;i++){
for(j=1;j<=NY;j++){
for(k=1;k<=NZ+1;k++){
tem_0[i][j][k]=tem[i][j][k];
}}}
}
data()isusedtooutputtheresultsfile.
voiddata(intn)
{
sprintf(fName,"temperature%d.dat",n);
if((fp=fopen(fName,"w"))==NULL)return;
fprintf(fp,"VARIABLES=X,Y,Z,T\n");
fprintf(fp,"Zone,I=%d,J=%d,K=%d,F=BLOCK\n",NX+2,NY+2,NZ+2);
for(k=0;k<=NZ+1;k++){
for(j=0;j<=NY+1;j++){
for(i=0;i<=NX+1;i++){
fprintf(fp,"%d\t",i);
}
fprintf(fp,"\n");
}
}
for(k=0;k<=NZ+1;k++){
for(j=0;j<=NY+1;j++){
for(i=0;i<=NX+1;i++){
fprintf(fp,"%d\t",j);
}
fprintf(fp,"\n");
}
}
for(k=0;k<=NZ+1;k++){
for(j=0;j<=NY+1;j++){
for(i=0;i<=NX+1;i++){
fprintf(fp,"%d\t",k);
}
fprintf(fp,"\n");
}
}
for(k=0;k<=NZ+1;k++){
for(j=0;j<=NY+1;j++){
for(i=0;i<=NX+1;i++){
fprintf(fp,"%.5e\t",tem[i][j][k]);
}
fprintf(fp,"\n");
}
}
fclose(fp);
}
output()isusedtodrawthegridmap.
voidoutput()
{
FILE*file;
file=fopen("flag.dat","w");
if(file==0)printf("cannotopenflagfile");
fprintf(file,"Title=\"flag\"\n");
fprintf(file,"variables=\"x\",\"y\",\"z\",\"flag\"\n");
fprintf(file,"zoneT=\"BOX\",I=%d,J=%d,K=%d\n",NX+2,NY+2,NZ+2);
for(k=0;k<=NZ+1;k++){
for(j=0;j<=NY+1;j++){
for(i=0;i<=NX+1;i++){
fprintf(file,"%d,%d,%d,%d\n",i,j,k,flag[i][j][k]);
}
}
}
fclose(file);
}
(3.6)Throughtheresultsoftheprocedure,wecaneasilygetthetimeofdecresingfrom1560to1450is133.62,whereitcost6681stepscoupledwithourTimeintervalofdtis0.02
Whatdoyouthinkofthiscourse?
Firstofall,thiscourseisaninternationalcourseofferedbytheInstituteofmaterialsscience,materialsscience,materialsscience,andotherprofessionalgraduatestudentsordoctoralstudentsinHuazhongUniversityofScienceandTechnology.Thiscourseemphasizestheconnotationandextensionofteachingguide,basedon"student-centered,teacherled"thestartingpointtothecurriculumasthecarrierandplatform,thepositioninginthecoursewiththehelpofavarietyofteachingmethodstocultivatestudents'comprehensiveability,solidfoundationoftheoreticalknowledgeandanalysisofengineeringproblems,makethecourseaswiththecharacteristicsof"research"teaching.
Meanwhile,teachersinthiscourseareverydetailed,fromtheorytothemodel,fromtheprincipletopractice,fromdiscretetoprogramming,stepbystepisverydetailed.Wenotonlystudytheproblemsinphysicsandengineeringbackground,butalsolearnhowtousethefiniteelementmethodandfinitedifferencetothediscretemodel.What’smore,welearntousesomesoftwaressuchasMATLABprogrammingtosimulatethephysicalprocess,soIthinkitisveryusefulforthiscourseandtheirgreatharvest.
Finally,thiscoursehasbeenfinishedononlyafewweeks,leavingaverydeepimpressiononme.Ialsolearnedalotofacknowledgefromit.Thankprofessorsintheclassforgivingussuchawonderfulcourse.
得分
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 有限 差分法 应用 实验 报告