{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

co-located-code

# co-located-code - program main c equal order example real...

This preview shows pages 1–3. Sign up to view the full content.

program main cccccccccccccccccccccccccc c equal order example cccccccccccccccccccccccccc real p1,p2,p3,pb,pc,deltax real a1,a2,a3,c1,cb,cc,c3 real u1,u2,u3,ub,uc real p1prime,pbprime,pcprime, p3prime real d1,d2,d3,db,dc real u1hat,ubhat,uchat,u2hat,u3hat real alphap,alphau real uresid, cresid integer iter integer itermax real cprime c... problem parameters cprime =10 a1=6 ab=5 a2=4 ac=3 a3=2 c1=cprime cb=cprime cc=cprime c3=cprime u1=10 u3=30 deltax=2 c... initial guesses ub=15 uc=15 p1=120 p3=120 pb=120 pc=120 p2= (pb+pc)/2. c... set one pressure correction to zero pcprime=0.0

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
c... under-relaxation, convergence tolerance, max iters alphap=0.8 alphau=0.8 tol=1.e-6 itermax=30 do iter=1,itermax print *,' ' print *,'*** iter = ', iter, '***' c... find momentum coeffs and under-relax apb =cb*abs(ub)*deltax apc =cc*abs(uc)*deltax apb=apb/alphau apc = apc/alphau bb= (1-alphau)*apb*ub bc =(1-alphau)*apc*uc print *,'Under-relaxed apb,bb,apc,bc=',apb,bb,apc,bc c... find momentum residuals and normalize with ap*up uresid= (abs(apb*ub -(p1-p2)-bb)+ + abs(apc*uc -(p2-p3)-bc)) + /(abs(apb*ub)+abs(apc*uc)) c...
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

co-located-code - program main c equal order example real...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online