Skip to content

Commit c269b6d

Browse files
committed
miscellaneous
1 parent 41a39f2 commit c269b6d

8 files changed

+12
-9
lines changed
29 Bytes
Binary file not shown.
55 Bytes
Binary file not shown.

Solver/Chemical_Equilibrium/SolveProblem.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,18 @@
99
----------------------------------------------------------------------
1010
"""
1111
from Solver.Chemical_Equilibrium.Equilibrate import equilibrate
12+
from Solver.Shocks_and_detonations.Shock_incident import shock_incident
1213

1314
def SolveProblem(self, i):
14-
if not i:
15-
self.PS.strP.append(equilibrate(self, self.PS.strR[i], self.PD.pP.Value))
16-
else:
17-
self.PS.strP.append(equilibrate(self, self.PS.strR[i], self.PD.pP.Value, self.PS.strP[i - 1]))
15+
if not any(self.PD.ProblemType.upper() == pt for pt in ['SHOCK_I', 'SHOCK_R', 'DET', 'DET_OVERDRIVEN']):
16+
if not i:
17+
self.PS.strP.append(equilibrate(self, self.PS.strR[i], self.PD.pP.Value))
18+
else:
19+
self.PS.strP.append(equilibrate(self, self.PS.strR[i], self.PD.pP.Value, self.PS.strP[i - 1]))
20+
elif self.PD.ProblemType.upper() == 'SHOCK_I':
21+
str1, str2 = shock_incident(self, self.PS.strR[i], self.PD.pR.Value, self.PD.TR.Value, self.PD.u1.Value)
22+
self.PS.strR.append(str1)
23+
self.PS.strP.append(str2)
1824

1925
return self
2026

Binary file not shown.
Binary file not shown.

Solver/Functions/ComputeProperties.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def __init__(self, app, SpeciesMatrix, p, T):
4848
self.mi = sum(SpeciesMatrix[:, 10]) * 1e-3 # [kg]
4949
self.rho = self.mi / self.v * 1e3 # [kg/m3]
5050
self.Yi = SpeciesMatrix[:, 10] / self.mi * 1e-3 # [-]
51-
self.cP = sum(SpeciesMatrix[:, 5] * self.Yi) # [J/K]
52-
self.cV = sum(SpeciesMatrix[:, 6] * self.Yi) # [J/K]
51+
self.cP = sum(SpeciesMatrix[:, 5]) # [J/K]
52+
self.cV = sum(SpeciesMatrix[:, 6]) # [J/K]
5353
self.W = 1/np.nansum(self.Yi / SpeciesMatrix[:, 11]) # []
5454
Ni = SpeciesMatrix[:, 0] # [mol]
5555
self.Xi = Ni / self.N # [-]

Solver/Functions/SetSpecies.py

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
Office 1.1.D22, Universidad Carlos III de Madrid
1010
"""
1111
import numpy as np
12-
from NASA_database.set_reference_form_of_elements_with_T_intervals import set_reference_form_of_elements_with_T_intervals
13-
from NASA_database.isRefElm import isRefElm
14-
from NASA_database.detect_location_of_phase_specifier import detect_location_of_phase_specifier
1512

1613
def SetSpecies(self, Species, N, T):
1714
M = self.C.M0.Value.copy()
Binary file not shown.

0 commit comments

Comments
 (0)