WSNet is an integrated deep learning library specifically designed for high-fidelity surrogate modeling in engineering applications. It provides a unified pipeline for fluid dynamics emulation, structural analysis, and design optimization with comprehensive support for classical surrogate models, neural networks, and modern neural operator algorithms.
WSNet features a completely reorganized architecture with clear separation of concerns:
wsnet/
├── models/ # Surrogate models (classical, neural, multi-fidelity, ensemble)
├── training/ # Training frameworks and utilities
├── data/ # Data loading and preprocessing
├── sampling/ # Design of Experiments and infill strategies
└── utils/ # Core utilities
A modular repository of surrogate models categorized by their mathematical formulation:
classical/: Classical response surface algorithms- Includes: PRS (Polynomial Response Surface), RBF (Radial Basis Function), KRG (Kriging), SVR (Support Vector Regression)
neural/: Neural network models- Includes: MLP (Multi-Layer Perceptron), DeepONet, GeoFNO (Geometry-aware Fourier Neural Operator), HyperFlowNet, Transolver
multi_fidelity/: Multi-fidelity models- Includes: CCA-MFS, MFS-MLS, MMFS
ensemble/: Ensemble models- Includes: T-AHS, AES-MSI
Training frameworks and utilities:
base_trainer.py: Base trainer class for custom training workflowsstd_trainer.py: Standard trainer for static regression tasksrollout_trainer.py: Trainer for autoregressive sequence predictionteacher_forcing_trainer.py: Teacher forcing trainer for sequence predictionbase_criterion.py: Loss functions and evaluation metrics
Data loading and preprocessing utilities:
flow_data.py: CFD data loading and preprocessingscaler.py: Data scaling utilities (StandardScaler, MinMaxScaler)boundary.py: Boundary condition detection and enforcementflow_vis.py: Flow field visualization and animationflow_plot.py: Training curves, error heatmaps, and metrics plots
Design of Experiments and infill strategies:
doe.py: Design of Experiments (LHS, optimized LHS)base_infill.py: Base infill sampling strategyso_infill.py: Single-objective infill strategy (Expected Improvement)mo_infill.py: Multi-objective infill strategymf_infill.py: Multi-fidelity infill strategy
Core utilities and helper functions:
seeder.py: Reproducibility utilities (seed everything)hue_logger.py: Colored logging with ANSI formattingsweep.py: Hyperparameter sweep utilities
- CFD-Ready Pipeline: Direct ingestion of ANSYS Fluent data with automatic coordinate and field mapping
- Physics-Informed Training: Support for physics constraints and loss functions
- Multi-Fidelity Support: Comprehensive multi-fidelity modeling capabilities
- Ensemble Methods: Advanced ensemble techniques for improved accuracy
- Neural Operator Algorithms: Modern neural operator implementations for complex physics
- Comprehensive Visualization Tools: Built-in CFD visualization and rendering
- Standardized API: Consistent "initialize, fit, predict" pattern across all models
wsnet.training.base_trainer.Trainer: Base trainer interfacewsnet.data.flow_data.FlowData: CFD data loaderwsnet.sampling.doe.lhs_design: Optimized Latin Hypercube Sampling
The library follows a consistent "initialize, fit, predict" pattern:
# Initialize
model = SomeModel(parameters)
# Fit/Train
trainer = SomeTrainer(model=model)
trainer.fit(train_data, val_data)
# Predict
predictions = model.predict(test_data)Check the examples/ directory for complete workflow examples:
flow_config.py+flow_train.py: CFD emulation pipeline (HyperFlowNet / GeoFNO / Transolver) with training, inference, and visualizationaero_config.py+aero_demo.py: Aerodynamic optimization benchmark platform with ensemble, multi-fidelity, sequential sampling, and optimization demos
- Python 3.8+
- PyTorch 1.10+
- NumPy
- SciPy
- Matplotlib
- PiVista
- tqdm
git clone https://github.com/SN-WANG/wsnet.git
cd wsnet
pip install -e .This project is licensed under the MIT License - see the LICENSE file for details.
For questions and support, please contact:
- Shengning Wang (王晟宁) - snwang2023@163.com
- Project Website: https://github.com/SN-WANG/wsnet
If you use WSNet in your research, please cite:
@software{wsnet2026,
author = {Shengning Wang},
title = {WSNet: A Deep Learning Library for Engineering Surrogate Modeling},
year = {2026},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/SN-WANG/wsnet}}
}