AirfoilEnv3D
- class fluidgym.envs.airfoil.AirfoilEnv3D(n_agents: int, reynolds_number: float, adaptive_cfl: float, step_length: float, episode_length: int, dt: float, attack_angle_deg: float, local_obs_window: int, use_marl: bool, local_reward_weight: float | None, local_2d_obs: bool = False, init_from_2d: bool = True, dtype: dtype = torch.float32, cuda_device: device | None = None, debug: bool = False, load_initial_domain: bool = True, load_domain_statistics: bool = True, randomize_initial_state: bool = True, enable_actions: bool = True, differentiable: bool = False, advection_tol: phipict.solvers.tolerance.SolverTolerance = None, pressure_tol: phipict.solvers.tolerance.SolverTolerance = None, pressure_tol_intermediate: phipict.solvers.tolerance.SolverTolerance = None, pressure_warm_start: bool = False, linear_solve_max_iter: int | None = None, exclude_advection_solve_gradients: bool | None = None, exclude_pressure_solve_gradients: bool | None = None, exclude_pressure_gradient_adjoint: bool | None = None, n_envs: int | None = None)[source]
Bases:
AirfoilEnvBaseEnvironment for 3D airfoil aerodynamic efficiency improvement.
- Parameters:
n_agents (int) – The number of agents controlling the synthetic jets.
reynolds_number (float) – The Reynolds number of the flow.
adaptive_cfl (float) – Target CFL number for adaptive time stepping.
step_length (float) – The non-dimensional time length of each environment step.
episode_length (int) – The number of steps per episode.
dt (float) – The time step size to use in the simulation.
attack_angle_deg (float) – The angle of attack of the airfoil in degrees.
local_obs_window (int) – The size of the local observation window for each agent.
use_marl (bool) – Whether to enable multi-agent reinforcement learning mode.
local_reward_weight (float | None) – The weight of the local reward in the combined reward for each agent. Has to be set if multi-agent step function is used. Defaults to None.
local_2d_obs (bool) – Whether to use 2D local observations (velocity in x and y directions only, a single sensor layer and window = 1). Defaults to False.
init_from_2d (bool) – Whether to initialize the 3D flow field from a 2D initial domain. This significantly reduces the initial transient phase. If the initial domain is loaded from disk, this parameter is not active. Defaults to True.
dtype (torch.dtype) – The data type to use for the simulation. Defaults to torch.float32.
cuda_device (torch.device | None) – The CUDA device to use for the simulation. If None, the default cuda device is used. Defaults to None.
debug (bool) – Whether to enable debug mode. Defaults to False.
load_initial_domain (bool) – Whether to load initial domain states from disk. Defaults to True.
load_domain_statistics (bool) – Whether to load domain statistics from disk. Defaults to True.
randomize_initial_state (bool) – Whether to randomize the initial state on reset. Defaults to True.
enable_actions (bool) – Whether to enable actions. If False, the environment will be run in uncontrolled mode. Defaults to True.
differentiable (bool) – Whether to enable differentiable simulation mode. Defaults to False.
advection_tol (float | SolverTolerance | Mapping | None) – Tolerance for the momentum and passive-scalar advection solves. None (the default) keeps the tolerance this environment is tuned at.
pressure_tol (float | SolverTolerance | Mapping | None) – Tolerance for the pressure solve. None (the default) keeps the tolerance this environment is tuned at.
pressure_tol_intermediate (float | SolverTolerance | Mapping | None) – Tolerance for the pressure solves before the final corrector. None (the default) applies
pressure_toleverywhere.pressure_warm_start (bool) – Whether to seed each pressure solve with the previous sub-step’s result. Defaults to False.
linear_solve_max_iter (int | None) – Iteration limit for the advection and pressure solves. None (the default) leaves the solver’s own limit in place.
exclude_advection_solve_gradients (bool | None) – Drop the gradient of the advection solve. Diagnostic only; None (the default) keeps it.
exclude_pressure_solve_gradients (bool | None) – Drop the gradient of the pressure solve. Diagnostic only; None (the default) keeps it.
exclude_pressure_gradient_adjoint (bool | None) – Drop the pressure path of the PISO velocity-correction backward. Diagnostic only; None (the default) keeps it.
n_envs: int | None
Number of environments simulated together, see
FluidEnv. None (the default) is a singleenvironment.
References
[1] R. Montalà et al., “Discovering Flow Separation Control Strategies in 3D Wings via Deep Reinforcement Learning,” Sept. 12, 2025, arXiv: arXiv:2509.10185. doi: 10.48550/arXiv.2509.10185.