Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Example: csg_cfd_simulation

Figure 12.4 — Example: CSG CFD Simulation

Crate: cfd-suite (workspace root)
Run: cargo run --example csg_cfd_simulation
Source: examples/csg_cfd_simulation.rs

What This Example Demonstrates

Blueprint-native geometry construction → mesh generation → 1D venturi screening in a single end-to-end pipeline using the cfd-schematics → gaia → cfd-1d path.

StageAPI
Parametric venturi blueprintcfd_schematics::venturi_rect(...)
Blueprint validationblueprint.validate()
Mesh generationBlueprintMeshPipeline::run(&blueprint, &config)
1D flow screeningevaluate_venturi_screening(VenturiScreeningInput {...})
Cavitation risk assessmentassess_venturi_screening(&screening)

Key Code Snippet

use cfd_schematics::venturi_rect;
use cfd_mesh::application::pipeline::{BlueprintMeshPipeline, PipelineConfig};
use cfd_1d::{evaluate_venturi_screening, VenturiScreeningInput};

let blueprint = venturi_rect("demo", 2.0e-3, 0.7e-3, 1.0e-3, 2.4e-3);
blueprint.validate()?;

let mut mesh = BlueprintMeshPipeline::run(&blueprint, &PipelineConfig {
    circular_segments: 24, axial_rings: 12, ..Default::default()
})?;

let screening = evaluate_venturi_screening(VenturiScreeningInput {
    upstream_pressure_pa:  160_000.0,
    throat_velocity_m_s:   2.85,
    density_kg_m3:         1_025.0,
    vapor_pressure_pa:     3_170.0,
    ..
})?;

Architecture

cfd-schematics (parametric blueprint)
  └─ gaia (mesh generation)
       └─ cfd-1d (screening / reduced-order model)

Book Chapter

← Geometry Construction and CFD Coupling