[Nek5000-users] Planar average in z-direction problem (image updated)
nek5000-users at lists.mcs.anl.gov
nek5000-users at lists.mcs.anl.gov
Thu Jul 26 08:07:39 CDT 2018
DearPaul,Thankyouforyourecommendation.Asyousaid,IalsounderstandthatmycodeisnotMPIfriendly.But,mytopicwasmalfunctionoftheplanar_average_zinmycaseandIjustwantedtoknowwhetherthereareanyproblemsinmygridpoints.Infact,Inoticedthatmycomputationaldomainswith4boxesmadefrom.boxfilehavesomeproblems.(So,Iwroteacodetogeneratemeshgridfor1boxwithclustering.AndImanuallyassignedgridpointsthen,problemwassolved.)Ithinkconnectivitybetweeneachboxwasbadatthetime.Regards,Hyunduk.------------------------------------------------------------------------------------------------------------------------------------------------------Title:Re:Planaraverageinz-directionproblem(imageupdated)DearHyunduk,Iseeseveralissueswiththecodeyouhave.Thefirstpointisthatyourcodewillnotworkproperlyinparallel,soyouneedtobecarefulaboutparalleltreatmentofIOifyouarerunningonmorethanoneMPIrank.Secondly,it'sgenerallynotagoodideatotestforequalitywithrealnumbers--areyoucertainthattheyvaluesofinterestare0.0000000?oraretheypotentially1.e-7(say).Someofthemeshgenerationtoolswillhavenoiseandyourzerovaluesmightnotbeexactlyzero.zgm1isthepositionofthenodalpointsontheinterval[-1,1]inthereferenceelementarea()isthesurfaceareaatthetopandbottomofeachelement.(Here,weassumethat"top"inzmeansalsotopinr-s-tspaceforthecanonicalOmega-hat:=[-1,1]^3.)Thus,aaisalinearcombinationoftheareaatthetopofthegivenelementandbottomofthegivenelement.Thiswaythesurfaceintegralcanhandletaperedelements(butnothingmorecomplexthanthat).hth,Paul------------------------------------------------------------------------------------------------------------------------------------------------------Title:Planaraverageinz-directionproblem(imageupdated)Hi,NeksIwonderwhyplanar_average_zinnavier5.fshowswrongresult.hereIattached2images.1,https://drive.google.com/file/d/1Kng9HZfQW-TGTFwmFcXzbrcvhRYrQSdc/view?usp=sharing2.https://drive.google.com/file/d/1FN3i5mE6VSoPeehG5evjC33WrD3J4lB5/view?usp=sharingFirstimageshowsthez-directionalgridspointsfromzm1(Iwroteacodetoextractzcoordinateaty=0asfollows:======================================================insnum=nidinsuni=insnum+1000WRITE(insnam,98)'inst_field_',insnumOPEN(unit=insuni,file=insnaminsnum=nidinsuni=insnum+1000WRITE(insnam,98)'inst_field_',insnumOpen(unit=insuni,file=insnam)doi=1,nif(ym1(i,1,1,1).eq.0.0)thenWRITE(insuni,5)xm1(i,1,1,1)%,zm1(i,1,1,1)%,vx(i,1,1,1)%,vy(i,1,1,1)%,vz(i,1,1,1)%,phig(i,1,1,1)endifenddoCLOSE(insuni)======================================================Then,Icancollectlotsoffielddatafromeachprocessorandsortdatawithascendingorderusingmatlab.So,Igottheresultas1stimage.ButwhenIuseplannar_average_zIgottheresultasshownin2ndimage.1.Ireallywanttomodifytheproblems,socouldyougivemeyourideaonthisproblem?2.Additionally,couldyouexplain'zgm1'and'area'?Inoticedthat,planar_average_rors...inturbChannelcasehasalso'area'but,thosecaseareusedtocalculateondifferentdirection.Buttheyusedsameinputparameters.WhatIunderstandaboutareais,surfaceareaofelement.ButIthoughtthatdifferentdirectionneedsdifferentindexing=======================================================subroutineplanar_average_z(ua,u,w1,w2)ccComputer-splanaraverageofquantityu()cinclude'SIZE'include'GEOM'include'PARALLEL'include'WZ'include'ZPER'crealua(lz1,nelz),u(lx1*ly1,lz1,nelv),w1(lz1,nelz),w2(lz1,nelz)integere,eg,ezcmelxy=nelx*nelycnz=lz1*nelzcallrzero(ua,nz)callrzero(w1,nz)cdoe=1,neltceg=lglel(e)cez=1+(eg-1)/melxycallget_exyz(ex,ey,ez,eg,nelx,nely,nelz)cdok=1,lz1doi=1,lx1*ly1zz=(1.-zgm1(k,3))/2.!=1fork=1,=0fork=lz1aa=zz*area(i,1,5,e)+(1-zz)*area(i,1,6,e)!wgtdjacobianw1(k,ez)=w1(k,ez)+aaua(k,ez)=ua(k,ez)+aa*u(i,k,e)enddoenddoenddoccallgop(ua,w2,'+',nz)callgop(w1,w2,'+',nz)cdoi=1,nzua(i,1)=ua(i,1)/w1(i,1)!Normalizeenddocreturnend======================================================Regards,Hyunduk.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20180726/5d427961/attachment.html>
More information about the Nek5000-users
mailing list