Skip to content

Commit 48b100b

Browse files
committed
fix some small issues
1 parent 10036ef commit 48b100b

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

toolchain/mfc/case_validator.py

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,6 @@ def check_continuum_damage(self):
10551055
cont_damage_s = self.get('cont_damage_s')
10561056
alpha_bar = self.get('alpha_bar')
10571057
model_eqns = self.get('model_eqns')
1058-
hypoelasticity = self.get('hypoelasticity', 'F') == 'T'
10591058

10601059
self.prohibit(tau_star is None,
10611060
"tau_star must be specified for cont_damage")
@@ -1065,27 +1064,27 @@ def check_continuum_damage(self):
10651064
"alpha_bar must be specified for cont_damage")
10661065
self.prohibit(model_eqns != 2,
10671066
"cont_damage requires model_eqns = 2")
1068-
self.prohibit(hypoelasticity,
1069-
"cont_damage is not compatible with hypoelasticity")
10701067

10711068
def check_grcbc(self):
10721069
"""Checks Generalized Relaxation Characteristics BC (simulation)"""
10731070
for dir in ['x', 'y', 'z']:
1074-
grcbc_in_beg = self.get(f'bc_{dir}%grcbc_in')
1075-
grcbc_out_beg = self.get(f'bc_{dir}%grcbc_out')
1076-
grcbc_vel_out_beg = self.get(f'bc_{dir}%grcbc_vel_out')
1071+
grcbc_in = self.get(f'bc_{dir}%grcbc_in', 'F') == 'T'
1072+
grcbc_out = self.get(f'bc_{dir}%grcbc_out', 'F') == 'T'
1073+
grcbc_vel_out = self.get(f'bc_{dir}%grcbc_vel_out', 'F') == 'T'
10771074
bc_beg = self.get(f'bc_{dir}%beg')
10781075
bc_end = self.get(f'bc_{dir}%end')
10791076

1080-
if grcbc_in_beg:
1077+
if grcbc_in:
1078+
# Check if EITHER beg OR end is set to -7
10811079
self.prohibit(bc_beg != -7 and bc_end != -7,
1082-
f"Subsonic Inflow (grcbc_in) requires bc_{dir} = -7")
1083-
if grcbc_out_beg:
1080+
f"Subsonic Inflow (grcbc_in) requires bc_{dir}%beg = -7 or bc_{dir}%end = -7")
1081+
if grcbc_out:
1082+
# Check if EITHER beg OR end is set to -8
10841083
self.prohibit(bc_beg != -8 and bc_end != -8,
1085-
f"Subsonic Outflow (grcbc_out) requires bc_{dir} = -8")
1086-
if grcbc_vel_out_beg:
1084+
f"Subsonic Outflow (grcbc_out) requires bc_{dir}%beg = -8 or bc_{dir}%end = -8")
1085+
if grcbc_vel_out:
10871086
self.prohibit(bc_beg != -8 and bc_end != -8,
1088-
f"Subsonic Outflow (grcbc_vel_out) requires bc_{dir} = -8")
1087+
f"Subsonic Outflow Velocity (grcbc_vel_out) requires bc_{dir}%beg = -8 or bc_{dir}%end = -8")
10891088

10901089
def check_probe_integral_output(self):
10911090
"""Checks probe and integral output requirements (simulation)"""
@@ -1298,13 +1297,12 @@ def check_perturb_density(self):
12981297
"perturb_sph_fluid must be between 0 and num_fluids")
12991298

13001299
def check_chemistry(self):
1301-
"""Checks chemistry constraints (pre-process)"""
1302-
chemistry = self.get('chemistry', 'F') == 'T'
1303-
num_species = self.get('num_species', 0)
1304-
1305-
if chemistry:
1306-
self.prohibit(num_species <= 0,
1307-
"chemistry requires num_species > 0")
1300+
"""Checks chemistry constraints (pre-process)
1301+
1302+
Note: num_species is set automatically by Cantera at runtime when cantera_file
1303+
is provided. No static validation is performed here - chemistry will fail at
1304+
runtime if misconfigured.
1305+
"""
13081306

13091307
def check_misc_pre_process(self):
13101308
"""Checks miscellaneous pre-process constraints"""

0 commit comments

Comments
 (0)