Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conf/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
defaults:
- problem: ldc
- solver: fv
- validation: fv
- mlflow: local
- machine: local
- _self_
Expand Down
26 changes: 26 additions & 0 deletions conf/experiment/fv_validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# @package _global_
# FV Solver validation against Ghia benchmark
# Usage: uv run python run_solver.py +experiment=fv_validation
# uv run python run_solver.py -m +experiment=fv_validation (sweep all)

defaults:
- override /solver: fv

# MLflow experiment (shared with spectral_validation)
experiment_name: LDC-Validation
# Parent run name - use same name across fv/spectral to group them
sweep_name: validation

# Validation grid sizes and Reynolds numbers
N: 32
Re: 100
tolerance: 1.0e-6
max_iterations: 10000

hydra:
sweeper:
params:
N: 32,64
Re: 100


21 changes: 21 additions & 0 deletions conf/experiment/validation/convergence/fv-regu-1000.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# @package _global_
# Convergence test - FV solver reference with Saad regularization at Re=1000
# N=128 as reference solution for spectral convergence

defaults:
- override /solver: fv
- override /validation: fv-regu

# MLflow experiment
experiment_name: LDC-Convergence
sweep_name: regu-Re1000

# Use Saad/polynomial corner treatment for regularized problem
solver:
corner_treatment: saad

hydra:
sweeper:
params:
Re: 1000
N: 128
21 changes: 21 additions & 0 deletions conf/experiment/validation/convergence/fv-regu-400.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# @package _global_
# Convergence test - FV solver reference with Saad regularization at Re=400
# N=128 as reference solution for spectral convergence

defaults:
- override /solver: fv
- override /validation: fv-regu

# MLflow experiment
experiment_name: LDC-Convergence
sweep_name: regu-Re400

# Use Saad/polynomial corner treatment for regularized problem
solver:
corner_treatment: saad

hydra:
sweeper:
params:
Re: 400
N: 128
21 changes: 21 additions & 0 deletions conf/experiment/validation/convergence/spectral-regu-1000.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# @package _global_
# Convergence test - Spectral solver with Saad regularization at Re=1000
# Sweep over N values with polynomial corner treatment

defaults:
- override /solver: spectral/fsg
- override /validation: fv-regu

# MLflow experiment
experiment_name: LDC-Convergence
sweep_name: regu-Re1000

# Use Saad/polynomial corner treatment for regularized problem
solver:
corner_treatment: saad

hydra:
sweeper:
params:
Re: 1000
N: 48, 64, 80, 96, 112, 128
21 changes: 21 additions & 0 deletions conf/experiment/validation/convergence/spectral-regu-400.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# @package _global_
# Convergence test - Spectral solver with Saad regularization at Re=400
# Sweep over N values with polynomial corner treatment

defaults:
- override /solver: spectral/fsg
- override /validation: fv-regu

# MLflow experiment
experiment_name: LDC-Convergence
sweep_name: regu-Re400

# Use Saad/polynomial corner treatment for regularized problem
solver:
corner_treatment: saad

hydra:
sweeper:
params:
Re: 400
N: 24, 32, 40, 48, 56, 64
20 changes: 20 additions & 0 deletions conf/experiment/validation/convergence/spectral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# @package _global_
# Ghia validation - Spectral solvers
# Sweeps over SG, FSG, VMG, FMG solvers at N=15

defaults:
- override /solver: spectral/sg

# MLflow experiment
experiment_name: LDC-Validation
sweep_name: convergence-rate-2

# Validation parameters

hydra:
sweeper:
params:
# Sweep over spectral solver types
solver: spectral/fsg #,spectral/fsg
Re: 1000
N: 80, 90, 100, 110, 120, 130, 140
2 changes: 1 addition & 1 deletion conf/experiment/validation/ghia/fv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ hydra:
sweeper:
params:
# Sweep over FV grid sizes
N: 32
N: 64
Re: 100
2 changes: 1 addition & 1 deletion conf/experiment/validation/ghia/spectral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ hydra:
# Sweep over spectral solver types
solver: spectral/fsg #,spectral/fsg
Re: 100
N: 27
N: 12, 14, 16, 18, 20
5 changes: 5 additions & 0 deletions conf/solver/fv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ limiter: MUSCL
alpha_uv: 0.4 # velocity under-relaxation
alpha_p: 0.2 # pressure under-relaxation
linear_solver_tol: 1.0e-9

# Corner singularity treatment
# Options: "none", "smoothing", or "saad"/"polynomial"
corner_treatment: none
corner_smoothing: 0.15 # smoothing width for "smoothing" method
4 changes: 2 additions & 2 deletions conf/solver/spectral/sg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ max_iterations: ${max_iterations}

# Spectral-specific parameters
basis_type: chebyshev # "chebyshev" or "legendre"
CFL: 0.5
CFL: 2.5
beta_squared: 5.0 # artificial compressibility parameter

# Corner singularity treatment
# Options: "smoothing" (simple cosine smoothing) or "subtraction" (Botella & Peyret 1998)
# Options: "smoothing" or "saad"/"polynomial"
corner_treatment: smoothing
corner_smoothing: 0.15 # smoothing width (fraction of domain) for smoothing method

Expand Down
3 changes: 3 additions & 0 deletions conf/validation/fv-regu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @package validation
# Regularized FV reference data (Saad polynomial lid velocity)
reference_dir: data/validation/fv-regu
3 changes: 3 additions & 0 deletions conf/validation/fv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @package validation
# Standard FV reference data (constant lid velocity)
reference_dir: data/validation/fv
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions data/validation/fv-regu/Re1000/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Lx: 1.0
Ly: 1.0
N: 128
Re: 1000
experiment_name: LDC-Convergence
lid_velocity: 1.0
max_iterations: 100000
mlflow:
mode: coolify
project_prefix: ''
tracking_uri: ${oc.env:MLFLOW_TRACKING_URI}
plot_only: false
solver:
Lx: ${Lx}
Ly: ${Ly}
Re: ${Re}
_target_: solvers.fv.solver.FVSolver
alpha_p: 0.2
alpha_uv: 0.4
convection_scheme: TVD
corner_smoothing: 0.15
corner_treatment: saad
lid_velocity: ${lid_velocity}
limiter: MUSCL
linear_solver_tol: 1.0e-09
max_iterations: ${max_iterations}
name: fv
nx: ${N}
ny: ${N}
tolerance: ${tolerance}
sweep_name: regu-Re1000
tolerance: 1.0e-06
Binary file added data/validation/fv-regu/Re1000/convergence.pdf
Binary file not shown.
Binary file added data/validation/fv-regu/Re1000/fields.pdf
Binary file not shown.
Binary file not shown.
61 changes: 61 additions & 0 deletions data/validation/fv-regu/Re1000/solution.vts

Large diffs are not rendered by default.

Binary file added data/validation/fv-regu/Re1000/streamlines.pdf
Binary file not shown.
Binary file added data/validation/fv-regu/Re1000/streamlines_3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/validation/fv-regu/Re1000/vorticity.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions data/validation/fv-regu/Re400/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Lx: 1.0
Ly: 1.0
N: 128
Re: 400
experiment_name: LDC-Convergence
lid_velocity: 1.0
max_iterations: 100000
mlflow:
mode: coolify
project_prefix: ''
tracking_uri: ${oc.env:MLFLOW_TRACKING_URI}
plot_only: false
solver:
Lx: ${Lx}
Ly: ${Ly}
Re: ${Re}
_target_: solvers.fv.solver.FVSolver
alpha_p: 0.2
alpha_uv: 0.4
convection_scheme: TVD
corner_smoothing: 0.15
corner_treatment: saad
lid_velocity: ${lid_velocity}
limiter: MUSCL
linear_solver_tol: 1.0e-09
max_iterations: ${max_iterations}
name: fv
nx: ${N}
ny: ${N}
tolerance: ${tolerance}
sweep_name: regu-Re400
tolerance: 1.0e-06
Binary file added data/validation/fv-regu/Re400/convergence.pdf
Binary file not shown.
Binary file added data/validation/fv-regu/Re400/fields.pdf
Binary file not shown.
Binary file added data/validation/fv-regu/Re400/ghia_comparison.pdf
Binary file not shown.
61 changes: 61 additions & 0 deletions data/validation/fv-regu/Re400/solution.vts

Large diffs are not rendered by default.

Binary file added data/validation/fv-regu/Re400/streamlines.pdf
Binary file not shown.
Binary file added data/validation/fv-regu/Re400/streamlines_3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/validation/fv-regu/Re400/vorticity.pdf
Binary file not shown.
30 changes: 30 additions & 0 deletions data/validation/fv/Re100/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Lx: 1.0
Ly: 1.0
N: 128
Re: 100
experiment_name: LDC-Validation
lid_velocity: 1.0
max_iterations: 100000
mlflow:
mode: coolify
project_prefix: ''
tracking_uri: ${oc.env:MLFLOW_TRACKING_URI}
plot_only: false
solver:
Lx: ${Lx}
Ly: ${Ly}
Re: ${Re}
_target_: solvers.fv.solver.FVSolver
alpha_p: 0.2
alpha_uv: 0.4
convection_scheme: TVD
lid_velocity: ${lid_velocity}
limiter: MUSCL
linear_solver_tol: 1.0e-09
max_iterations: ${max_iterations}
name: fv
nx: ${N}
ny: ${N}
tolerance: ${tolerance}
sweep_name: Hpc-baseline-fv
tolerance: 1.0e-06
Binary file added data/validation/fv/Re100/convergence.pdf
Binary file not shown.
Binary file added data/validation/fv/Re100/fields.pdf
Binary file not shown.
Binary file added data/validation/fv/Re100/ghia_comparison.pdf
Binary file not shown.
61 changes: 61 additions & 0 deletions data/validation/fv/Re100/solution.vts

Large diffs are not rendered by default.

Binary file added data/validation/fv/Re100/streamlines.pdf
Binary file not shown.
Binary file added data/validation/fv/Re100/streamlines_3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/validation/fv/Re100/vorticity.pdf
Binary file not shown.
30 changes: 30 additions & 0 deletions data/validation/fv/Re1000/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Lx: 1.0
Ly: 1.0
N: 128
Re: 1000
experiment_name: LDC-Validation
lid_velocity: 1.0
max_iterations: 100000
mlflow:
mode: coolify
project_prefix: ''
tracking_uri: ${oc.env:MLFLOW_TRACKING_URI}
plot_only: false
solver:
Lx: ${Lx}
Ly: ${Ly}
Re: ${Re}
_target_: solvers.fv.solver.FVSolver
alpha_p: 0.2
alpha_uv: 0.4
convection_scheme: TVD
lid_velocity: ${lid_velocity}
limiter: MUSCL
linear_solver_tol: 1.0e-09
max_iterations: ${max_iterations}
name: fv
nx: ${N}
ny: ${N}
tolerance: ${tolerance}
sweep_name: Hpc-baseline-fv
tolerance: 1.0e-06
Binary file added data/validation/fv/Re1000/convergence.pdf
Binary file not shown.
Binary file added data/validation/fv/Re1000/fields.pdf
Binary file not shown.
Binary file added data/validation/fv/Re1000/ghia_comparison.pdf
Binary file not shown.
61 changes: 61 additions & 0 deletions data/validation/fv/Re1000/solution.vts

Large diffs are not rendered by default.

Binary file added data/validation/fv/Re1000/streamlines.pdf
Binary file not shown.
Binary file added data/validation/fv/Re1000/streamlines_3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/validation/fv/Re1000/vorticity.pdf
Binary file not shown.
30 changes: 30 additions & 0 deletions data/validation/fv/Re400/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Lx: 1.0
Ly: 1.0
N: 128
Re: 400
experiment_name: LDC-Validation
lid_velocity: 1.0
max_iterations: 100000
mlflow:
mode: coolify
project_prefix: ''
tracking_uri: ${oc.env:MLFLOW_TRACKING_URI}
plot_only: false
solver:
Lx: ${Lx}
Ly: ${Ly}
Re: ${Re}
_target_: solvers.fv.solver.FVSolver
alpha_p: 0.2
alpha_uv: 0.4
convection_scheme: TVD
lid_velocity: ${lid_velocity}
limiter: MUSCL
linear_solver_tol: 1.0e-09
max_iterations: ${max_iterations}
name: fv
nx: ${N}
ny: ${N}
tolerance: ${tolerance}
sweep_name: Hpc-baseline-fv
tolerance: 1.0e-06
Binary file added data/validation/fv/Re400/convergence.pdf
Binary file not shown.
Binary file added data/validation/fv/Re400/fields.pdf
Binary file not shown.
Binary file added data/validation/fv/Re400/ghia_comparison.pdf
Binary file not shown.
61 changes: 61 additions & 0 deletions data/validation/fv/Re400/solution.vts

Large diffs are not rendered by default.

Binary file added data/validation/fv/Re400/streamlines.pdf
Binary file not shown.
Binary file added data/validation/fv/Re400/streamlines_3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/validation/fv/Re400/vorticity.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/reports/TexReport
Submodule TexReport updated from 5a8cb0 to 662102
6 changes: 6 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ def run_solver(cfg: DictConfig) -> str:
log.info(f"Solving: {solver_name} N={cfg.N} Re={cfg.Re}")
solver.solve()

# Compute validation errors against reference FV solution
reference_dir = cfg.get("validation", {}).get("reference_dir", "data/validation/fv")
validation_errors = solver.compute_validation_errors(reference_dir=reference_dir)
if validation_errors:
mlflow.log_metrics(validation_errors)

mlflow.log_metrics(solver.metrics.to_mlflow())
if solver.time_series:
batch = solver.time_series.to_mlflow_batch()
Expand Down
2 changes: 1 addition & 1 deletion scripts/hpc_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def main():
parser = argparse.ArgumentParser(description="Submit HPC job array")
parser.add_argument("experiment", help="Experiment (e.g., +experiment/validation/ghia=fv)")
parser.add_argument("--queue", "-q", default="hpc", help="LSF queue (default: hpc)")
parser.add_argument("--time", "-W", default="1:00", help="Wall time (default: 1:00)")
parser.add_argument("--time", "-W", default="6:00", help="Wall time (default: 1:00)")
parser.add_argument("--cores", "-n", type=int, default=4, help="Cores per job (default: 4)")
parser.add_argument("--mem", default="6GB", help="Memory per core (default: 4GB)")
parser.add_argument("--dry-run", action="store_true", help="Show commands without submitting")
Expand Down
Loading
Loading