ldc.FVSolver#

class ldc.FVSolver(**kwargs)[source]#

Bases: LidDrivenCavitySolver

Finite 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:
configFVinfo

Configuration with physics (Re, lid velocity, domain size) and FV-specific parameters (nx, ny, convection scheme, etc.).

Methods

__init__

Initialize FV solver.

save

Save results to HDF5 file.

solve

Solve the lid-driven cavity problem using iterative stepping.

step

Perform one SIMPLE iteration.

Attributes

rho

Examples using ldc.FVSolver#

Lid-Driven Cavity Flow Computation

Lid-Driven Cavity Flow Computation
Config#

alias of FVinfo

ResultFields#

alias of FVResultFields

rho = 1.0#
save(filepath)#

Save results to HDF5 file.

Parameters:
filepathstr or Path

Output file path.

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.metadata : Metadata dataclass with solver metadata

Parameters:
tolerancefloat, optional

Convergence tolerance. If None, uses config.tolerance.

max_iterint, optional

Maximum iterations. If None, uses config.max_iterations.

step()[source]#

Perform one SIMPLE iteration.

Returns:
u, v, pnp.ndarray

Updated velocity and pressure fields