Skip to content
Closed
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
2 changes: 1 addition & 1 deletion conf/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ N: 32

# Solver control
tolerance: 1.0e-6
max_iterations: 100000
max_iterations: 500000

# Experiment naming
experiment_name: LDC-Dev
Expand Down
21 changes: 21 additions & 0 deletions conf/experiment/validation/convergence/spectral-regu-100.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=100
# Sweep over N values with polynomial corner treatment

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

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

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

hydra:
sweeper:
params:
Re: 100
N: 8, 10, 12, 14, 16, 18, 20, 24, 28, 32
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defaults:

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

# Use Saad/polynomial corner treatment for regularized problem
solver:
Expand All @@ -18,4 +18,4 @@ hydra:
sweeper:
params:
Re: 1000
N: 48, 64, 80, 96, 112, 128
N: 14, 16, 18, 20, 22, 24, 26, 28, 30
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ hydra:
sweeper:
params:
Re: 400
N: 24, 32, 40, 48, 56, 64
N: 10, 12, 14, 16, 18, 20, 24, 28, 32
8 changes: 4 additions & 4 deletions conf/experiment/validation/ghia/spectral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ defaults:

# MLflow experiment
experiment_name: LDC-Validation
sweep_name: ghia-Re${Re}
sweep_name: ghia-HPC

# Validation parameters

hydra:
sweeper:
params:
# Sweep over spectral solver types
solver: spectral/fsg #,spectral/fsg
Re: 100
N: 12, 14, 16, 18, 20
solver: spectral/fsg #,spectral/vmg #, spectral/vmg
Re: 400, 1000
N: 12, 14, 16, 18, 20, 24, 28, 32, 36, 40, 46, 50, 56, 60, 64, 68, 74, 82, 86, 90
37 changes: 37 additions & 0 deletions conf/experiment/validation/mms/spectral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# MMS (Method of Manufactured Solutions) test for spectral solver
#
# Usage:
# uv run python scripts/test_sg_mms.py -m # Uses default sweep N=6,8,10
# uv run python scripts/test_sg_mms.py -m N=6,8,10,12,14
# uv run python scripts/test_sg_mms.py N=10 # Single run

defaults:
- override /hydra/launcher: joblib

# MMS test parameters
Re: 1 # Low Re for faster convergence (diffusion-dominated)
tolerance: 1.0e-14
max_iterations: 1000000

# Grid size (use -m N=6,8,10 for sweep)
N: 10

# Solver-specific settings for MMS
CFL: 0.2
corner_treatment: smoothing
corner_smoothing: 0.0 # No smoothing for MMS (exact BCs)

# Hydra sweeper and parallel launcher
hydra:
sweeper:
params:
N: 6,8,10,16,24,26,30,32,34,36
Re: 100
launcher:
n_jobs: 4
callbacks:
mms_plot:
_target_: callbacks.mms_callback.MMSPlotCallback

# Output
output_dir: outputs
17 changes: 0 additions & 17 deletions conf/solver/spectral/fmg.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion conf/solver/spectral/fsg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ name: spectral_fsg
# FSG Multigrid settings
multigrid: fsg
n_levels: 3
coarse_tolerance_factor: 10.0
coarse_tolerance_factor: 1.0
prolongation_method: fft
restriction_method: fft
2 changes: 1 addition & 1 deletion conf/solver/spectral/sg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ max_iterations: ${max_iterations}

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

# Corner singularity treatment
Expand Down
17 changes: 0 additions & 17 deletions conf/solver/spectral/vmg.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions data/validation/botella/botella_Re1000_vortex.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Botella & Peyret (1998) - Benchmark spectral solution for lid-driven cavity
# Reference: J. Comp. Phys. 179, 439-468 (2002) - Tables VIII and IX
# Primary and secondary vortex characteristics at Re=1000 with regularized lid velocity
# N=160 polynomial order (highest resolution benchmark)
#
# Primary vortex (PV): global minimum of streamfunction
# BR (bottom-right): secondary vortex in bottom-right corner
# BL (bottom-left): secondary vortex in bottom-left corner
# TL (top-left): secondary vortex in top-left corner (absent at Re=1000)
#
Re,psi_min,psi_min_x,psi_min_y,omega_center,psi_BR,psi_BR_x,psi_BR_y,psi_BL,psi_BL_x,psi_BL_y
1000,-0.1189366,0.5308,0.5652,2.067782,1.7520e-5,0.8640,0.1118,2.3072e-4,0.0833,0.0781
2 changes: 1 addition & 1 deletion docs/reports/TexReport
Submodule TexReport updated from 662102 to 0ed9d3
46 changes: 46 additions & 0 deletions jobs/mms_sweep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
#BSUB -J mms_sweep
#BSUB -q hpc
#BSUB -W 4:00
#BSUB -n 16
#BSUB -R "rusage[mem=8GB]"
#BSUB -R "span[hosts=1]"
#BSUB -o logs/mms_sweep_%J.out
#BSUB -e logs/mms_sweep_%J.err

# MMS (Method of Manufactured Solutions) validation sweep
# Tests spectral convergence across multiple N values and Reynolds numbers
#
# Usage:
# bsub < jobs/mms_sweep.sh

echo "============================================"
echo "MMS Validation Sweep"
echo "============================================"
echo "Job ID: $LSB_JOBID"
echo "Host: $(hostname)"
echo "Date: $(date)"
echo "============================================"

# Create logs directory if needed
mkdir -p logs

# Change to project directory
cd $HOME/ANA-P3 || { echo "Failed to cd to project dir"; exit 1; }

# Run the MMS sweep (parameters from conf/experiment/validation/mms/spectral.yaml)
echo ""
echo "Starting MMS sweep..."
echo ""

uv run python scripts/test_sg_mms.py -m

echo ""
echo "============================================"
echo "MMS sweep completed at $(date)"
echo "============================================"

# List generated figures
echo ""
echo "Generated figures:"
ls -la figures/mms_*.pdf 2>/dev/null || echo "No figures found"
3 changes: 3 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ def run_solver(cfg: DictConfig) -> str:
if batch:
mlflow.tracking.MlflowClient().log_batch(run.info.run_id, metrics=batch)

# Log validation metrics comparison table
solver.mlflow_log_validation_table()

with tempfile.TemporaryDirectory() as tmpdir:
vtk_path = Path(tmpdir) / "solution.vts"
solver.to_vtk().save(str(vtk_path))
Expand Down
4 changes: 2 additions & 2 deletions scripts/hpc_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ 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="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("--time", "-W", default="0:30", help="Wall time (default: 0:30)")
parser.add_argument("--cores", "-n", type=int, default=6, 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")
parser.add_argument("--test-index", type=int, help="Test: show command for specific index")
Expand Down
Loading