rtx-cfd: PatchConvection::TvdVanAlbada — van Albada deferred correction on the curvilinear predictor (downwind-side linear weight, gradient-ratio r over the face d lengths, far-upwind across the opposite face, boundary faces upwind); annulus MMS orders 2.10/1.69 at 0.24× upwind; cylinder-flag MMS orders 1.98/1.97 (1.06× upwind — diffusion-dominated, recorded); knobs RTX_OVERSET_CFD1_TVD, RTX_OVERSET_MAX_ROUNDS, RTX_CF_SCHEME
CI / Test (ubuntu-latest) (push) Canceled after 0s
CI / Build CPU-Only (Explicit) (push) Canceled after 0s
Documentation / Build User Guide (push) Canceled after 0s
CI / Format Check (push) Canceled after 0s
CI / Clippy Check (push) Canceled after 0s
CI / Build (macos-latest) (push) Canceled after 0s
CI / Build (ubuntu-latest) (push) Canceled after 0s
CI / Test (macos-latest) (push) Canceled after 0s
Performance Benchmarks / Run Benchmarks (push) Canceled after 0s
CI / Python Bindings (maturin) (macos-latest) (push) Canceled after 0s
CI / Python Bindings (maturin) (ubuntu-latest) (push) Canceled after 0s
CI / WASM Build + Size Check (push) Canceled after 0s
CI / Distributed Training Tests (push) Canceled after 0s
CI / CI Success (push) Canceled after 0s
Documentation / Build API Documentation (push) Canceled after 0s
CI / Test (ubuntu-latest) (push) Canceled after 0s
CI / Build CPU-Only (Explicit) (push) Canceled after 0s
Documentation / Build User Guide (push) Canceled after 0s
CI / Format Check (push) Canceled after 0s
CI / Clippy Check (push) Canceled after 0s
CI / Build (macos-latest) (push) Canceled after 0s
CI / Build (ubuntu-latest) (push) Canceled after 0s
CI / Test (macos-latest) (push) Canceled after 0s
Performance Benchmarks / Run Benchmarks (push) Canceled after 0s
CI / Python Bindings (maturin) (macos-latest) (push) Canceled after 0s
CI / Python Bindings (maturin) (ubuntu-latest) (push) Canceled after 0s
CI / WASM Build + Size Check (push) Canceled after 0s
CI / Distributed Training Tests (push) Canceled after 0s
CI / CI Success (push) Canceled after 0s
Documentation / Build API Documentation (push) Canceled after 0s
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01X2GmJXeQ2njUecEKiJZ1G2
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
02c855b9c4
commit
5f780447de
@@ -12,7 +12,7 @@ use rtx_cfd::mesh::patch_gen::cylinder_flag_patch;
|
||||
use rtx_cfd::solvers::incompressible::{
|
||||
AleBoundaries, CurvilinearParameters, CurvilinearPisoSolver, EmbeddedParameters,
|
||||
EmbeddedPisoSolver, FlowField, NormalDiffusion, OversetField, OversetParameters,
|
||||
OversetPisoSolver, PatchField, PoissonSolverKind, SideBoundary,
|
||||
OversetPisoSolver, PatchConvection, PatchField, PoissonSolverKind, SideBoundary,
|
||||
};
|
||||
use rtx_cfd::{CfdConfig, CfdResult};
|
||||
|
||||
@@ -99,10 +99,18 @@ async fn run_cfd1(ny: usize) -> CfdResult<Cfd1> {
|
||||
let dt_patch = 0.4 * (hs * hs / (4.0 * NU)).min(hs / u_peak);
|
||||
let dt = dt_bg.min(dt_patch);
|
||||
|
||||
// P4 step 2: `RTX_OVERSET_CFD1_TVD=1` puts the van Albada deferred
|
||||
// correction on the patch (the background stays upwind, as recorded).
|
||||
let convection = if std::env::var("RTX_OVERSET_CFD1_TVD").is_ok() {
|
||||
PatchConvection::TvdVanAlbada
|
||||
} else {
|
||||
PatchConvection::Upwind
|
||||
};
|
||||
let mut patch = CurvilinearPisoSolver::new(
|
||||
config,
|
||||
CurvilinearParameters {
|
||||
tolerance: 1e-5,
|
||||
convection,
|
||||
normal_diffusion: NormalDiffusion::LineImplicit,
|
||||
..CurvilinearParameters::default()
|
||||
},
|
||||
@@ -127,6 +135,12 @@ async fn run_cfd1(ny: usize) -> CfdResult<Cfd1> {
|
||||
.ok()
|
||||
.and_then(|v| v.parse().ok())
|
||||
.unwrap_or(2),
|
||||
// Cost question (P4): does the second corrector's ~9 rounds buy a
|
||||
// measurable load? `RTX_OVERSET_MAX_ROUNDS=3` caps every corrector.
|
||||
max_rounds: std::env::var("RTX_OVERSET_MAX_ROUNDS")
|
||||
.ok()
|
||||
.and_then(|v| v.parse().ok())
|
||||
.unwrap_or(OversetParameters::default().max_rounds),
|
||||
..OversetParameters::default()
|
||||
};
|
||||
let mut solver = OversetPisoSolver::new(background, patch, (nx, ny, h, h), params)?;
|
||||
@@ -274,9 +288,14 @@ async fn cfd1_on_the_overset_against_the_featflow_reference() -> CfdResult<()> {
|
||||
let r = run_cfd1(ny).await?;
|
||||
let rel = |a: f64, b: f64| 100.0 * (a - b) / b;
|
||||
println!(
|
||||
" CFD1 overset ny = {ny} (h = {:.4}, dt = {:.2e}): wall drag {:.4} ({:+.2}%) lift {:.4} ({:+.2}%); control volume drag {:.4} ({:+.2}%) lift {:.4}; routes differ {:.2}%; [{} steps, {:.0} s, Schwarz rounds mean {:.2}] reference {REF_DRAG} / {REF_LIFT}; embedded staircase at ny=41: 15.71 / 15.62 (+10%)",
|
||||
" CFD1 overset ny = {ny} (h = {:.4}, dt = {:.2e}, patch {}): wall drag {:.4} ({:+.2}%) lift {:.4} ({:+.2}%); control volume drag {:.4} ({:+.2}%) lift {:.4}; routes differ {:.2}%; [{} steps, {:.0} s, Schwarz rounds mean {:.2}] reference {REF_DRAG} / {REF_LIFT}; embedded staircase at ny=41: 15.71 / 15.62 (+10%)",
|
||||
H / ny as f64,
|
||||
r.dt,
|
||||
if std::env::var("RTX_OVERSET_CFD1_TVD").is_ok() {
|
||||
"tvd"
|
||||
} else {
|
||||
"upwind"
|
||||
},
|
||||
r.drag_surface,
|
||||
rel(r.drag_surface, REF_DRAG),
|
||||
r.lift_surface,
|
||||
|
||||
Reference in New Issue
Block a user