hydrogym.nek.AFC
The classical approaches for wing control Matching the structure from drl_repo_TEST/src/lib/AFC.py
AFC Objects
class AFC()
A general object for classical AFC approaches
policy
def policy(observation)
The control policy depends on the observation
predict
def predict(observations, state, episode_start, deterministic)
Return the action to ENV based on the policy
OppoCtrl Objects
class OppoCtrl(AFC)
Opposition control implementation
policy
def policy(observation)
v = -alpha * (v - <v>)
BLCtrl Objects
class BLCtrl(AFC)
Steady uniform blowing/suction
policy
def policy(observation)
v = Psi
SinWave Objects
class SinWave()
Imposing Sinusoidal wave to check the mean
load_node_info
def load_node_info(Node_Info)
Get the node info to impose the Sinusoidal Wave
policy
def policy(observation)
We define the V-Vel <==> 1
nameAgent
@staticmethod
def nameAgent(nid, gllid, iface, ix, iy, iz)
Name the agent based on the GRID information
ZeroCtrl Objects
class ZeroCtrl(AFC)
Zero action controller (no control)
make_afc_controller
def make_afc_controller(env, ctrl_type="AFC")
Factory function to create an AFC controller compatible with integrate().
The controller adapts between array-based (NekEnv) and dict-based (NekParallelEnv, NekPettingZooEnv) formats.
To use an SB3 model, you can pass it directly to integrate(): from stable_baselines3 import PPO loaded_model = PPO.load("path/to/model") hgym.integrate(env, ..., controller=loaded_model)
Arguments:
env- Environment instance (NekEnv, NekParallelEnv, or NekPettingZooEnv)ctrl_type- Algorithm name ("AFC", "OC", "BL", "SIN", "ZERO", or SB3 algorithm name)
Returns:
controller- Controller object with .predict() method, or None if not an AFC algorithm