source: CIVL/examples/fortran/nek5000/core/cmt/ausm.f

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100755
File size: 6.5 KB
Line 
1C> @file ausm.f Riemann solvers and other rocflu miscellany
2! ******************************************************************************
3!
4! Purpose: Compute convective fluxes using AUSM+ scheme.
5!
6! Description: None.
7!
8! Input:
9! nx x-component of face normal
10! ny y-component of face normal
11! nz z-component of face normal
12! nm Magnitude of face normal
13! fs Face speed
14! rl Density of left state
15! ul x-component of velocity of left state
16! vl y-component of velocity of left state
17! wl z-component of velocity of left state
18! Hl Total enthalpy of left state
19! al Speed of sound of left state
20! pl Pressure of left state
21! rr Density of right state
22! ur x-component of velocity of right state
23! vr y-component of velocity of right state
24! wr z-component of velocity of right state
25! pr Pressure of right state
26! Hr Total enthalpy of right state
27! ar Speed of sound of right state
28!
29! Output:
30! flx Fluxes
31! vf Face velocities ! NOT USED IN CMT-NEK YET
32!
33! Notes:
34! 1. Liou M.-S., Progress towards an improved CFD method: AUSM+, AIAA Paper
35! 95-1701, 1995
36! 2. Do not use computation of face speed of sound which leads to exact
37! capturing of isolated normal shock waves because of robustness problems
38! for unsteady flows and because that formulation is not applicable to
39! anything but calorically and thermally perfect gases.
40!
41! ******************************************************************************
42
43C> \ingroup isurf
44C> @{
45C> Computes inviscid numerical surface flux from AUSM+ Riemann solver
46 SUBROUTINE AUSM_FluxFunction(ntot,nx,ny,nz,nm,fs,rl,ul,vl,wl,pl,
47 > al,tl,rr,ur,vr,wr,pr,ar,tr,flx,el,er)
48
49! IMPLICIT NONE ! HAHAHHAHHAHA
50! ******************************************************************************
51! Definitions and declarations
52! ******************************************************************************
53 real MixtJWL_Enthalpy
54 external MixtJWL_Enthalpy
55
56! ==============================================================================
57! Arguments
58! ==============================================================================
59 integer ntot
60 REAL al(ntot),ar(ntot),fs(ntot),nm(ntot),nx(ntot),ny(ntot),
61 > nz(ntot),pl(ntot),pr(ntot),rl(ntot),rr(ntot),ul(ntot),
62 > ur(ntot),vl(ntot),vr(ntot),wl(ntot),wr(ntot),el(ntot),
63 > er(ntot),tl(ntot),tr(ntot)! INTENT(IN) ::
64 REAL flx(ntot,5)!,vf(3) ! INTENT(OUT) ::
65
66! ==============================================================================
67! Locals
68! ==============================================================================
69
70 REAL af,mf,mfa,mfm,mfp,ml,mla,mlp,mr,mra,mrm,pf,ql,qr,vml,vmr,
71 > wtl,wtr,Hl,Hr
72
73! ******************************************************************************
74! Start, compute face state
75! ******************************************************************************
76
77 do i=1,ntot
78! Change the Enthalpy
79 Hl = MixtJWL_Enthalpy(rl(i),pl(i),ul(i),vl(i),wl(i),el(i))
80 Hr = MixtJWL_Enthalpy(rr(i),pr(i),ur(i),vr(i),wr(i),er(i))
81
82 ql = ul(i)*nx(i) + vl(i)*ny(i) + wl(i)*nz(i) - fs(i)
83 qr = ur(i)*nx(i) + vr(i)*ny(i) + wr(i)*nz(i) - fs(i)
84
85 af = 0.5*(al(i)+ar(i)) ! NOTE not using original formulation, see note
86 ml = ql/af
87 mla = ABS(ml)
88
89 mr = qr/af
90 mra = ABS(mr)
91
92 IF ( mla .le. 1.0 ) THEN
93 mlp = 0.25*(ml+1.0)*(ml+1.0) + 0.125*(ml*ml-1.0)*(ml*ml-1.0)
94 wtl = 0.25*(ml+1.0)*(ml+1.0)*(2.0-ml) +
95 > 0.1875*ml*(ml*ml-1.0)*(ml*ml-1.0)
96 ELSE
97 mlp = 0.5*(ml+mla)
98 wtl = 0.5*(1.0+ml/mla)
99 END IF ! mla
100
101 IF ( mra .le. 1.0 ) THEN
102 mrm = -0.25*(mr-1.0)*(mr-1.0)-0.125*(mr*mr-1.0)*(mr*mr-1.0)
103 wtr = 0.25*(mr-1.0)*(mr-1.0)*(2.0+mr) -
104 > 0.1875*mr*(mr*mr-1.0)*(mr*mr-1.0)
105 ELSE
106 mrm = 0.5*(mr-mra)
107 wtr = 0.5*(1.0-mr/mra)
108 END IF ! mla
109
110 mf = mlp + mrm
111 mfa = ABS(mf)
112 mfp = 0.5*(mf+mfa)
113 mfm = 0.5*(mf-mfa)
114
115 pf = wtl*pl(i) + wtr*pr(i)
116
117! ******************************************************************************
118! Compute fluxes
119! ******************************************************************************
120
121! vf(1) = mfp*ul + mfm*ur ! I'm sure we'll need this someday
122! vf(2) = mfp*vl + mfm*vr
123! vf(3) = mfp*wl + mfm*wr
124
125 flx(i,1)=(af*(mfp*rl(i) +mfm*rr(i) ) )*nm(i)
126 flx(i,2)=(af*(mfp*rl(i)*ul(i)+mfm*rr(i)*ur(i))+pf*nx(i))*
127 > nm(i)
128 flx(i,3)=(af*(mfp*rl(i)*vl(i)+mfm*rr(i)*vr(i))+pf*ny(i))*
129 > nm(i)
130 flx(i,4)=(af*(mfp*rl(i)*wl(i)+mfm*rr(i)*wr(i))+pf*nz(i))*
131 > nm(i)
132 flx(i,5)=(af*(mfp*rl(i)*Hl +mfm*rr(i)*Hr) + pf*fs(i))*
133 > nm(i)
134 enddo
135C> @}
136 return
137 END
138
139!-----------------------------------------------------------------------
140! NOT LONG FOR THIS WORLD
141
142 SUBROUTINE CentralInviscid_FluxFunction(ntot,nx,ny,nz,fs,ul,pl,
143 > ur,pr,flx)
144! JH081915 More general, more obvious
145! JH111815 HEY GENIUS THIS MAY BE SECOND ORDER AND THUS KILLING YOUR
146! CONVERGENCE. REPLACE WITH AUSM AND SHITCAN IT
147! JH112015 This isn't why walls aren't converging. There's something
148! inherently second-order about your wall pressure. Think!
149 real nx(ntot),ny(ntot),nz(ntot),fs(ntot),ul(ntot,5),pl(ntot),
150 > ur(ntot,5),pr(ntot) ! intent(in)
151 real flx(ntot,5)! intent(out),dimension(5) ::
152
153 do i=1,ntot
154 rl =ul(i,1)
155 rul=ul(i,2)
156 rvl=ul(i,3)
157 rwl=ul(i,4)
158 rel=ul(i,5)
159
160 rr =ur(i,1)
161 rur=ur(i,2)
162 rvr=ur(i,3)
163 rwr=ur(i,4)
164 rer=ur(i,5)
165
166 ql = (rul*nx(i) + rvl*ny(i) + rwl*nz(i))/rl - fs(i)
167 qr = (rur*nx(i) + rvr*ny(i) + rwr*nz(i))/rr - fs(i)
168
169 flx(i,1) = 0.5*(ql* rl+ qr*rr )
170 flx(i,2) = 0.5*(ql* rul+pl(i)*nx(i) + qr* rur +pr(i)*nx(i))
171 flx(i,3) = 0.5*(ql* rvl+pl(i)*ny(i) + qr* rvr +pr(i)*ny(i))
172 flx(i,4) = 0.5*(ql* rwl+pl(i)*nz(i) + qr* rwr +pr(i)*nz(i))
173 flx(i,5) = 0.5*(ql*(rel+pl(i))+pl(i)*fs(i)+qr*(rer+pr(i))+
174 > pr(i)*fs(i))
175 enddo
176
177 return
178 end
Note: See TracBrowser for help on using the repository browser.