How venturi123/drlinfluids works
DRLinFluids couples reinforcement-learning agents to OpenFOAM simulations through framework-specific environment adapters. An agent supplies actions; the environment advances the CFD case, derives observations and rewards, and returns them for the next interaction. The package also provides OpenFOAM result parsing, dictionary-editing helpers, training logs, and parallel-environment support. The README documents scalable dictionary editing and parallel interfaces, but their internal wiring is not established by the sampled excerpts; those links are therefore omitted or marked unverified.
Main entry points: tianshou.py Tianshou environment · tensorforce.py Tensorforce environment · runner.py CFD runner · utils.py CFD utilities
Components 12
Agent interfaces
- Gym API
src/drlinfluids/environments/gym.py - Tensorforce environment
src/drlinfluids/environments/tensorforce.py - Tianshou environment
src/drlinfluids/environments/tianshou.py - Parallel interfaces
src/drlinfluids/environments
CFD execution
- CFD runner
src/drlinfluids/runner.py - OpenFOAM case
- Dictionary editor
src/drlinfluids/wrapper.py
Data and analysis
- CFD utilities
src/drlinfluids/utils.py - Result extractor
src/drlinfluids/extractor.py
Training support
- Training logger
src/drlinfluids/logger.py - Trainer namespace
src/drlinfluids/trainer
Other components
- RL agent
Connections 11
- RL agent → Tensorforce environment: sends actions
README.md - RL agent → Tianshou environment: sends actions
README.md - Tensorforce environment → CFD runner: initializes case
src/drlinfluids/environments/tensorforce.py - Tianshou environment → CFD runner: runs simulation
src/drlinfluids/environments/tianshou.py - CFD runner → OpenFOAM case: runs solver
src/drlinfluids/runner.py - Tensorforce environment → CFD utilities: reads probe data
src/drlinfluids/environments/tensorforce.py - Tianshou environment → CFD utilities: reads probe data
src/drlinfluids/environments/tianshou.py - Tianshou environment → Gym API: uses API
src/drlinfluids/environments/tianshou.py - CFD utilities → Result extractor: imports
src/drlinfluids/utils.py - Dictionary editor → OpenFOAM case: edits dictionaries
README.md - Parallel interfaces → RL agent: supports parallel use
README.md