rtx-cfd: overset_cfd1 RTX_OVERSET_ROWS — the overlap depth (patch rows kept non-hole below the acceptor row, default 4) as a knob for the §5.11 band probe; saved-field tags carry it; rows ≤ 3 are refused by the map at ny = 41 (acceptor donors reach the hole at the flag tip)
Documentation / Build User Guide (push) Canceled after 0s
CI / Python Bindings (maturin) (macos-latest) (push) Canceled after 0s
Documentation / Build API Documentation (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
Performance Benchmarks / Run Benchmarks (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
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 / Python Bindings (maturin) (macos-latest) (push) Canceled after 0s
Documentation / Build API Documentation (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
Performance Benchmarks / Run Benchmarks (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
CI / Test (ubuntu-latest) (push) Canceled after 0s
CI / Build CPU-Only (Explicit) (push) Canceled after 0s
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_0116sg1Qz1gMv9hdcKP1XUam
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
4c000266d9
commit
36af178980
@@ -25,6 +25,34 @@ const U_MEAN: f64 = 0.2;
|
|||||||
const REF_DRAG: f64 = 14.2929;
|
const REF_DRAG: f64 = 14.2929;
|
||||||
const REF_LIFT: f64 = 1.11905;
|
const REF_LIFT: f64 = 1.11905;
|
||||||
|
|
||||||
|
/// Tag of a settled-field set: resolution, scheme, and the overlap depth
|
||||||
|
/// when it is not the default (`RTX_OVERSET_ROWS`).
|
||||||
|
fn field_tag(ny: usize) -> String {
|
||||||
|
let rows = overlap_rows();
|
||||||
|
format!(
|
||||||
|
"ny{ny}_{}{}",
|
||||||
|
if std::env::var("RTX_OVERSET_CFD1_TVD").is_ok() {
|
||||||
|
"tvd"
|
||||||
|
} else {
|
||||||
|
"upwind"
|
||||||
|
},
|
||||||
|
if rows == OversetParameters::default().overlap_rows {
|
||||||
|
String::new()
|
||||||
|
} else {
|
||||||
|
format!("_rows{rows}")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `RTX_OVERSET_ROWS`: patch rows kept non-hole below the acceptor row
|
||||||
|
/// (the overlap depth; default 4). The band probe of §5.11.
|
||||||
|
fn overlap_rows() -> usize {
|
||||||
|
std::env::var("RTX_OVERSET_ROWS")
|
||||||
|
.ok()
|
||||||
|
.and_then(|v| v.parse().ok())
|
||||||
|
.unwrap_or(OversetParameters::default().overlap_rows)
|
||||||
|
}
|
||||||
|
|
||||||
fn inflow(y: f64) -> f64 {
|
fn inflow(y: f64) -> f64 {
|
||||||
1.5 * U_MEAN * y * (H - y) / (0.5 * H).powi(2)
|
1.5 * U_MEAN * y * (H - y) / (0.5 * H).powi(2)
|
||||||
}
|
}
|
||||||
@@ -143,6 +171,7 @@ async fn run_cfd1(ny: usize, max_steps: usize) -> CfdResult<Cfd1> {
|
|||||||
.ok()
|
.ok()
|
||||||
.and_then(|v| v.parse().ok())
|
.and_then(|v| v.parse().ok())
|
||||||
.unwrap_or(OversetParameters::default().max_rounds),
|
.unwrap_or(OversetParameters::default().max_rounds),
|
||||||
|
overlap_rows: overlap_rows(),
|
||||||
..OversetParameters::default()
|
..OversetParameters::default()
|
||||||
};
|
};
|
||||||
let mut solver = OversetPisoSolver::new(background, patch, (nx, ny, h, h), params)?;
|
let mut solver = OversetPisoSolver::new(background, patch, (nx, ny, h, h), params)?;
|
||||||
@@ -182,14 +211,7 @@ async fn run_cfd1(ny: usize, max_steps: usize) -> CfdResult<Cfd1> {
|
|||||||
// run offline in seconds instead of the 20–50 min settle.
|
// run offline in seconds instead of the 20–50 min settle.
|
||||||
let loaded = match std::env::var("RTX_OVERSET_CFD1_LOAD") {
|
let loaded = match std::env::var("RTX_OVERSET_CFD1_LOAD") {
|
||||||
Ok(dir) => {
|
Ok(dir) => {
|
||||||
let tag = format!(
|
let tag = field_tag(ny);
|
||||||
"ny{ny}_{}",
|
|
||||||
if std::env::var("RTX_OVERSET_CFD1_TVD").is_ok() {
|
|
||||||
"tvd"
|
|
||||||
} else {
|
|
||||||
"upwind"
|
|
||||||
}
|
|
||||||
);
|
|
||||||
let dir = std::path::Path::new(&dir);
|
let dir = std::path::Path::new(&dir);
|
||||||
field.background = FlowField::load(&dir.join(format!("bg_{tag}.bin")))?;
|
field.background = FlowField::load(&dir.join(format!("bg_{tag}.bin")))?;
|
||||||
let read = |name: &str| -> Vec<f64> {
|
let read = |name: &str| -> Vec<f64> {
|
||||||
@@ -308,6 +330,11 @@ async fn run_cfd1(ny: usize, max_steps: usize) -> CfdResult<Cfd1> {
|
|||||||
.overlap()
|
.overlap()
|
||||||
.region_force(&field.background, RHO, mu, |c| c == CellClass::Hole);
|
.region_force(&field.background, RHO, mu, |c| c == CellClass::Hole);
|
||||||
let wall = load.total();
|
let wall = load.total();
|
||||||
|
println!(
|
||||||
|
" overlap rows {} (patch nn {})",
|
||||||
|
overlap_rows(),
|
||||||
|
solver.patch().mesh().nn()
|
||||||
|
);
|
||||||
println!(
|
println!(
|
||||||
" momentum routes ny = {ny}: CV box ({drag_cv:.4}, {lift_cv:.4}) | ring outer ({:.4}, {:.4}) | hole boundary ({:.4}, {:.4}) | wall ({:.4}, {:.4}); defects [% of wall drag]: active {:+.2} fringe ring {:+.2} patch region {:+.2}",
|
" momentum routes ny = {ny}: CV box ({drag_cv:.4}, {lift_cv:.4}) | ring outer ({:.4}, {:.4}) | hole boundary ({:.4}, {:.4}) | wall ({:.4}, {:.4}); defects [% of wall drag]: active {:+.2} fringe ring {:+.2} patch region {:+.2}",
|
||||||
ring.0,
|
ring.0,
|
||||||
@@ -560,14 +587,7 @@ async fn run_cfd1(ny: usize, max_steps: usize) -> CfdResult<Cfd1> {
|
|||||||
// diagnostics without the march (background in `FlowField::save`'s
|
// diagnostics without the march (background in `FlowField::save`'s
|
||||||
// format; patch u, v, p as raw little-endian f64 vectors).
|
// format; patch u, v, p as raw little-endian f64 vectors).
|
||||||
if let Ok(dir) = std::env::var("RTX_OVERSET_CFD1_SAVE") {
|
if let Ok(dir) = std::env::var("RTX_OVERSET_CFD1_SAVE") {
|
||||||
let tag = format!(
|
let tag = field_tag(ny);
|
||||||
"ny{ny}_{}",
|
|
||||||
if std::env::var("RTX_OVERSET_CFD1_TVD").is_ok() {
|
|
||||||
"tvd"
|
|
||||||
} else {
|
|
||||||
"upwind"
|
|
||||||
}
|
|
||||||
);
|
|
||||||
let dir = std::path::Path::new(&dir);
|
let dir = std::path::Path::new(&dir);
|
||||||
std::fs::create_dir_all(dir).expect("save dir");
|
std::fs::create_dir_all(dir).expect("save dir");
|
||||||
field.background.save(&dir.join(format!("bg_{tag}.bin")))?;
|
field.background.save(&dir.join(format!("bg_{tag}.bin")))?;
|
||||||
|
|||||||
Reference in New Issue
Block a user