ldc.FVSolver#
- class ldc.FVSolver(**kwargs)[source]#
Bases:
LidDrivenCavitySolverFinite volume solver for lid-driven cavity problem.
This solver uses a collocated grid arrangement with Rhie-Chow interpolation for pressure-velocity coupling using the SIMPLE algorithm.
- Parameters:
- params
FVParameters Parameters with physics (Re, lid velocity, domain size) and FV-specific settings (nx, ny, convection scheme, etc.).
- params
Methods
__init__Initialize FV solver.
End MLflow run and log final metrics.
Log an artifact (e.g., saved HDF5 file) to MLflow.
Start MLflow run and log parameters.
Save complete solver state to HDF5 file.
Solve the lid-driven cavity problem using iterative stepping.
Perform one SIMPLE iteration.
Attributes
Examples using
ldc.FVSolver#- Parameters#
alias of
FVParameters
- mlflow_end()#
End MLflow run and log final metrics.
- mlflow_log_artifact(filepath: str)#
Log an artifact (e.g., saved HDF5 file) to MLflow.
- Parameters:
- filepath
str Path to the file to log as artifact.
- filepath
- mlflow_start(experiment_name: str, run_name: str, parent_run_name: str = None)#
Start MLflow run and log parameters.
- rho = 1.0#
- save(filepath)#
Save complete solver state to HDF5 file.
Saves params, metrics, time_series, and fields for later analysis.
- Parameters:
- filepath
strorPath Output file path (use .h5 extension).
- filepath
- solve(tolerance: float = None, max_iter: int = None)#
Solve the lid-driven cavity problem using iterative stepping.
This method implements the common iteration loop with residual calculation. Subclasses implement step() to define one iteration.
Stores results in solver attributes: - self.fields : Fields dataclass with solution fields - self.time_series : TimeSeries dataclass with time series data - self.metrics : Metrics dataclass with solver metrics
- step()[source]#
Perform one SIMPLE iteration.
- Returns:
- u, v, p
np.ndarray Updated velocity and pressure fields
- u, v, p