Skip to content

Commit

Permalink
Add pressure tensor computations
Browse files Browse the repository at this point in the history
  • Loading branch information
jaisw7 committed Mar 26, 2020
1 parent dd7e121 commit 5e22965
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions dgfs1D/std/moments.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,20 @@ def _compute_moments_1D(self, coeff):

# non-dimensional heat-flux
ele_sol[:,:,4] = mr*np.einsum('...j,...j,...j->...', soln,cSqr,cx)*mcw
ele_sol[:,:,5] = mr*np.einsum('...j,...j,...j->...', soln,cSqr,cy)*mcw

# dimensional rho, ux, uy, T, qx
ele_sol[:,:,0:5] *= np.array([
rho0, u0, u0, T0, 0.5*rho0*(u0**3)]).reshape(1,1,5)
# non-dimensional pressure-tensor components
ele_sol[:,:,6] = 2*mr*np.einsum('...j,...j,...j->...', soln,cx,cx)*mcw
ele_sol[:,:,7] = 2*mr*np.einsum('...j,...j,...j->...', soln,cy,cy)*mcw
ele_sol[:,:,8] = 2*mr*np.einsum('...j,...j,...j->...', soln,cx,cy)*mcw

# dimensional rho, ux, uy, T, qx, qy, Pxx, Pyy, Pxy
ele_sol[:,:,0:9] *= np.array([rho0, u0, u0, T0,
0.5*rho0*(u0**3), 0.5*rho0*(u0**3),
0.5*rho0*(u0**2), 0.5*rho0*(u0**2), 0.5*rho0*(u0**2)]).reshape(1,1,9)

# dimensional pressure
ele_sol[:,:,5] = (
ele_sol[:,:,9] = (
(mr*vm.R0/molarMass0)*ele_sol[:,:,0]*ele_sol[:,:,3])


Expand All @@ -75,7 +82,8 @@ def __init__(self, tcurr, im, xcoeff, coeff, vm, cfg, cfgsect,
self.basename += extn

# these variables are computed
privarmap = ['rho', 'U:x', 'U:y', 'T', 'Q:x', 'p']
privarmap = ['rho', 'U:x', 'U:y', 'T', 'Q:x', 'Q:y', 'P:xx', 'P:yy',
'P:xy', 'p']
Ns = len(privarmap)
self.fields = ", ".join(privarmap)

Expand Down

0 comments on commit 5e22965

Please sign in to comment.