限元与有限差分法应用实验报告Word文档下载推荐.docx
《限元与有限差分法应用实验报告Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《限元与有限差分法应用实验报告Word文档下载推荐.docx(25页珍藏版)》请在冰豆网上搜索。
![限元与有限差分法应用实验报告Word文档下载推荐.docx](https://file1.bdocx.com/fileroot1/2023-1/29/2a11d9f4-3278-40ee-ab5a-2225238f458e/2a11d9f4-3278-40ee-ab5a-2225238f458e1.gif)
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)
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;
3)DrawtheFDMgridmap,anddescribeitusingdatastructure;
4)ProvidethethermalpropertiesthermalpropertiesthermalpropertiesthermalpropertiesparametersofZG25,resinsandandtheair;
5)Programtosimulatethisphysicalprocess,assumingthecavitywasfilledveryfastandtheinitialtemperatureevenlydistributed.Pleaseprovidethemaincodeoftheprogram.(25points)
6)Howlongdoesittakewhilethehighesttemperatureofthecastingdropsto1450℃?
F
igure1:
3DmodeloftheH-shapedcasting
Figure2:
DimensionofH-shapedcasting
Figure3:
A2DsliceoftheH-shapedcasting
Q4
(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;
=58;
for(k=24;
=100;
flag[i][j][k]=1;
for(k=100;
=116;
k++){flag[i][j][k]=1;
}
for(k=116;
=132;
if(((i-48.0)*(i-48.0)+(j-18.0)*(j-18.0))<
=6.0*6.0)
(3.4)ThethermalpropertiesparametersofZG25,resinsandandtheairare:
heat
conduct
coefficient
density
specific
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;
=NX+1;
for(j=0;
=NY+1;
for(k=0;
=NZ+1;
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;
calculate_temperature()isusedtocalculatetheevolutionofthetemperaturefield.
voidcaculate_temperature()
doubleTEMPLE,t1,t2,t3,t4,t5,t6;
TEMPLE=0;
Tmax=0;
for(i=1;
=NX;
for(j=1;
=NY;
for(k=1;
=NZ;
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);
Tmax)
Tmax=tem[i][j][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"
);
Zone,I=%d,J=%d,K=%d,F=BLOCK\n"
NX+2,NY+2,NZ+2);
for(k=0;
for(j=0;
j<
j++){
for(i=0;
i<
i++){
fprintf(fp,"
%d\t"
i);
}
fprintf(fp,"
\n"
);
j);
k);
%.5e\t"
tem[i][j][k]);
fclose(fp);
output()isusedtodrawthegridmap.
voidoutput()
FILE*file;
file=fopen("
flag.dat"
"
if(file==0)printf("
cannotopenflagfile"
fprintf(file,"
Title=\"
flag\"
variables=\"
x\"
\"
y\"
z\"
zoneT=\"
BOX\"
I=%d,J=%d,K=%d\n"
NX+2,NY+2,NZ+2);
for(j=0;
for(i=0;
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.