Skip to content

Commit b8d0fe0

Browse files
sbryngelsonclaude
andcommitted
Skip non-Newtonian examples in CI (too expensive, no golden files)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b8b92b4 commit b8d0fe0

File tree

5 files changed

+42
-30
lines changed

5 files changed

+42
-30
lines changed

docs/module_categories.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
"m_chemistry",
2727
"m_acoustic_src",
2828
"m_body_forces",
29-
"m_pressure_relaxation"
29+
"m_pressure_relaxation",
30+
"m_hb_function",
31+
"m_re_visc"
3032
]
3133
},
3234
{

examples/2D_lid_driven_cavity_nn/case.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@
99
1010
Mesh stretching: cosh-based clustering near all 4 walls (x_a, x_b, y_a, y_b).
1111
"""
12+
1213
import json
1314

1415
eps = 1e-6
1516

1617
# HB model parameters
17-
tau0 = 0.0 # Yield stress (set to 0 for power-law fluid)
18-
K = 0.0002 # Consistency index (Re=5000: K = 1/5000)
19-
nn = 1.5 # Flow behavior index (shear-thickening)
20-
mu_min = 0.00002 # K * gdot_min^(n-1) = 0.0002 * (0.01)^0.5
21-
mu_max = 0.0632 # K * gdot_max^(n-1) = 0.0002 * (1e5)^0.5
22-
hb_m = 1000.0 # Papanastasiou regularization parameter
18+
tau0 = 0.0 # Yield stress (set to 0 for power-law fluid)
19+
K = 0.0002 # Consistency index (Re=5000: K = 1/5000)
20+
nn = 1.5 # Flow behavior index (shear-thickening)
21+
mu_min = 0.00002 # K * gdot_min^(n-1) = 0.0002 * (0.01)^0.5
22+
mu_max = 0.0632 # K * gdot_max^(n-1) = 0.0002 * (1e5)^0.5
23+
hb_m = 1000.0 # Papanastasiou regularization parameter
2324
mu_bulk = 0.0
2425

2526
lid_velocity = 1.0 # Lid velocity (m/s)

src/simulation/m_data_output.fpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ contains
918918
m_MOK = int(m_glb_save + 1, MPI_OFFSET_KIND)
919919
n_MOK = int(n_glb_save + 1, MPI_OFFSET_KIND)
920920
p_MOK = int(p_glb_save + 1, MPI_OFFSET_KIND)
921-
WP_MOK = int(8._wp, MPI_OFFSET_KIND)
921+
WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND)
922922
MOK = int(1._wp, MPI_OFFSET_KIND)
923923
str_MOK = int(name_len, MPI_OFFSET_KIND)
924924
NVARS_MOK = int(sys_size, MPI_OFFSET_KIND)
@@ -986,7 +986,7 @@ contains
986986
m_MOK = int(m_glb + 1, MPI_OFFSET_KIND)
987987
n_MOK = int(n_glb + 1, MPI_OFFSET_KIND)
988988
p_MOK = int(p_glb + 1, MPI_OFFSET_KIND)
989-
WP_MOK = int(8._wp, MPI_OFFSET_KIND)
989+
WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND)
990990
MOK = int(1._wp, MPI_OFFSET_KIND)
991991
str_MOK = int(name_len, MPI_OFFSET_KIND)
992992
NVARS_MOK = int(alt_sys, MPI_OFFSET_KIND)
@@ -1113,7 +1113,7 @@ contains
11131113
m_MOK = int(m_glb + 1, MPI_OFFSET_KIND)
11141114
n_MOK = int(n_glb + 1, MPI_OFFSET_KIND)
11151115
p_MOK = int(p_glb + 1, MPI_OFFSET_KIND)
1116-
WP_MOK = int(8._wp, MPI_OFFSET_KIND)
1116+
WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND)
11171117
MOK = int(1._wp, MPI_OFFSET_KIND)
11181118

11191119
write (file_loc, '(A)') 'ib.dat'

toolchain/mfc/case_validator.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,7 @@ def check_parameter_types(self):
285285
self.prohibit(not self.is_set("x_domain%beg"), "x_domain%beg must be set when m > 0")
286286
self.prohibit(not self.is_set("x_domain%end"), "x_domain%end must be set when m > 0")
287287

288-
# ===================================================================
289288
# Common Checks (All Stages)
290-
# ===================================================================
291289

292290
def check_simulation_domain(self):
293291
"""Checks constraints on dimensionality and number of cells"""
@@ -474,7 +472,7 @@ def check_bubbles_euler(self):
474472
self.prohibit(model_eqns == 4 and num_fluids != 1, "4-equation model (model_eqns = 4) is single-component and requires num_fluids = 1")
475473
self.prohibit(cyl_coord, "Bubble models untested in cylindrical coordinates")
476474

477-
# === BUBBLE PHYSICS PARAMETERS ===
475+
# BUBBLE PHYSICS PARAMETERS
478476
# Validate bubble reference parameters (bub_pp%)
479477
R0ref = self.get("bub_pp%R0ref")
480478
p0ref = self.get("bub_pp%p0ref")
@@ -639,9 +637,7 @@ def check_mhd(self):
639637
self.prohibit(mhd and n is not None and n == 0 and Bx0 is None, "Bx0 must be set in 1D MHD simulations")
640638
self.prohibit(mhd and n is not None and n > 0 and Bx0 is not None, "Bx0 must not be set in 2D/3D MHD simulations")
641639

642-
# ===================================================================
643640
# Simulation-Specific Checks
644-
# ===================================================================
645641

646642
def check_riemann_solver(self):
647643
"""Checks constraints on Riemann solver (simulation only)"""
@@ -1202,9 +1198,7 @@ def check_hyperelasticity(self):
12021198
self.prohibit(model_eqns == 1, "hyperelasticity is not supported for model_eqns = 1")
12031199
self.prohibit(model_eqns is not None and model_eqns > 3, "hyperelasticity is not supported for model_eqns > 3")
12041200

1205-
# ===================================================================
12061201
# Pre-Process Specific Checks
1207-
# ===================================================================
12081202

12091203
def check_restart(self):
12101204
"""Checks constraints on restart parameters (pre-process)"""
@@ -1371,15 +1365,15 @@ def check_patch_physics(self):
13711365
alter_patches = [self.get(f"patch_icpp({i})%alter_patch({j})") == "T" for j in range(1, num_patches + 1)]
13721366
is_special = hcid is not None or any(alter_patches)
13731367

1374-
# === THERMODYNAMICS ===
1368+
# THERMODYNAMICS
13751369
# Pressure must be positive for physical stability
13761370
# (skip for special patches where values are computed differently)
13771371
if not is_special:
13781372
pres = self.get(f"patch_icpp({i})%pres")
13791373
if pres is not None and self._is_numeric(pres):
13801374
self.prohibit(pres <= 0, f"patch_icpp({istr})%pres must be positive (got {pres})")
13811375

1382-
# === FLUID PROPERTIES ===
1376+
# FLUID PROPERTIES
13831377
# (skip for special patches where values are computed differently)
13841378
if not is_special:
13851379
for j in range(1, num_fluids + 1):
@@ -1399,7 +1393,7 @@ def check_patch_physics(self):
13991393
if alpha_rho is not None and self._is_numeric(alpha_rho):
14001394
self.prohibit(alpha_rho < 0, f"patch_icpp({istr})%alpha_rho({jstr}) must be non-negative (got {alpha_rho})")
14011395

1402-
# === GEOMETRY ===
1396+
# GEOMETRY
14031397
# Patch dimensions must be positive (except in cylindrical coords where
14041398
# length_y/length_z can be sentinel values like -1000000.0)
14051399
length_x = self.get(f"patch_icpp({i})%length_x")
@@ -1418,7 +1412,7 @@ def check_patch_physics(self):
14181412
if radius is not None and self._is_numeric(radius):
14191413
self.prohibit(radius <= 0, f"patch_icpp({istr})%radius must be positive (got {radius})")
14201414

1421-
# === BUBBLES ===
1415+
# BUBBLES
14221416
# Bubble radius must be positive
14231417
if bubbles_euler:
14241418
r0 = self.get(f"patch_icpp({i})%r0")
@@ -1472,9 +1466,7 @@ def check_bc_patches(self):
14721466
# BC types -14 to -4, -1 (periodic), or < -17 (dirichlet) are incompatible with patches
14731467
self.prohibit((-14 <= bc_type <= -4) or bc_type == -1 or bc_type < -17, f"Incompatible BC type for boundary condition patch {i}")
14741468

1475-
# ===================================================================
14761469
# Post-Process Specific Checks
1477-
# ===================================================================
14781470

14791471
def check_output_format(self):
14801472
"""Checks output format parameters (post-process)"""
@@ -1715,9 +1707,7 @@ def check_no_flow_variables(self):
17151707

17161708
self.prohibit(not has_output, "None of the flow variables have been selected for post-process")
17171709

1718-
# ===================================================================
17191710
# Cross-Cutting Physics Checks
1720-
# ===================================================================
17211711

17221712
def check_domain_bounds(self):
17231713
"""Checks that domain end > domain begin for each active dimension"""
@@ -1978,9 +1968,7 @@ def check_velocity_components(self):
19781968
if vel3 is not None and self._is_numeric(vel3):
19791969
self.prohibit(vel3 != 0, f"patch_icpp({i})%vel(3) = {vel3} but p = 0 (1D/2D simulation)")
19801970

1981-
# ===================================================================
19821971
# Build-Flag Compatibility Checks
1983-
# ===================================================================
19841972

19851973
def check_build_flags(self):
19861974
"""Checks case parameters against the active build configuration.
@@ -1998,9 +1986,7 @@ def check_geometry_precision_simulation(self):
19981986
p = self.get("p", 0)
19991987
self.prohibit(CFG().single and cyl_coord and p > 0, "Fully 3D cylindrical geometry (cyl_coord = T, p > 0) is not supported in single precision (--single)")
20001988

2001-
# ===================================================================
20021989
# Main Validation Entry Points
2003-
# ===================================================================
20041990

20051991
def validate_common(self):
20061992
"""Validate parameters common to all stages"""

toolchain/mfc/test/cases.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,28 @@ def alter_num_fluids(dimInfo):
401401

402402
stack.pop()
403403

404+
if num_fluids == 1:
405+
# Non-Newtonian viscosity (Herschel-Bulkley)
406+
stack.push(
407+
"Non-Newtonian",
408+
{
409+
"viscous": "T",
410+
"dt": 1e-11,
411+
"patch_icpp(1)%vel(1)": 1.0,
412+
"fluid_pp(1)%Re(1)": 10.0,
413+
"fluid_pp(1)%non_newtonian": "T",
414+
"fluid_pp(1)%tau0": 0.0,
415+
"fluid_pp(1)%K": 0.1,
416+
"fluid_pp(1)%nn": 0.5,
417+
"fluid_pp(1)%hb_m": 1000.0,
418+
"fluid_pp(1)%mu_min": 1e-4,
419+
"fluid_pp(1)%mu_max": 10.0,
420+
},
421+
)
422+
cases.append(define_case_d(stack, "shear-thinning", {}))
423+
cases.append(define_case_d(stack, "Bingham", {"fluid_pp(1)%tau0": 0.1, "fluid_pp(1)%nn": 1.0, "fluid_pp(1)%K": 0.01}))
424+
stack.pop()
425+
404426
if num_fluids == 2:
405427
stack.push(
406428
"Viscous",
@@ -1541,7 +1563,8 @@ def foreach_example():
15411563
"3D_IGR_33jet",
15421564
"1D_multispecies_diffusion",
15431565
"2D_ibm_stl_MFCCharacter",
1544-
"1D_qbmm", # formatted I/O field overflow on gfortran 12
1566+
"2D_lid_driven_cavity_nn",
1567+
"2D_poiseuille_nn",
15451568
]
15461569
if path in casesToSkip:
15471570
continue

0 commit comments

Comments
 (0)