Topology optimization of incompressible internal flows using legacy FEniCS (dolfin). The repository includes a frozen-Spalart-Allmaras turbulent solver, a laminar solver, and steady Spalart-Allmaras forward-solver verification cases.
All topology-optimization files are in FluidTO/.
TurbulentTO_Frozen.py: turbulent topology-optimization driver using a frozen-turbulence adjoint.LaminarTO.py: laminar topology-optimization driver.TurbulenceModel_SpalartAllmaras_TO_Frozen.py: Spalart-Allmaras model used by the turbulent driver.Utilities_TurbulentTO_Frozen.py: wall-distance and turbulent penalization helpers.Utilities_SharedTO.py: mesh, boundary, logging, checkpoint, and output helpers shared by both drivers.mma.py: Method of Moving Asymptotes optimizer.
The following cases have configurations and meshes in the repository.
Use TurbulentTO_Frozen.py for all three cases.
- Yoon diffuser:
Configs_Frozen/Config_DiffuserYoon_Frozen.pywithMeshes/DiffuserYoon/. - Alexandersen pipe bend:
Configs_Frozen/Config_PipeBendAlexandersen_Frozen.pywithMeshes/PipeBendAlexandersen/. - Alexandersen U-bend:
Configs_Frozen/Config_UBendAlexandersen_Frozen.pywithMeshes/UBendAlexandersen/.
Use LaminarTO.py for all three cases.
- Yoon diffuser:
Configs_Laminar/Config_DiffuserYoon_Laminar.pywithMeshes/DiffuserYoon/. - Alexandersen pipe bend:
Configs_Laminar/Config_PipeBendAlexandersen_Laminar.pywithMeshes/PipeBendAlexandersen/. - Alexandersen U-bend:
Configs_Laminar/Config_UBendAlexandersen_Laminar.pywithMeshes/UBendAlexandersen/.
Finite-difference and Taylor sensitivity checks use these configurations:
- Yoon diffuser:
Configs_Frozen/Config_DiffuserYoon_Frozen_Sensitivity.py. - Alexandersen pipe bend:
Configs_Frozen/Config_PipeBendAlexandersen_Frozen_Sensitivity.py.
Each sensitivity configuration imports its corresponding base configuration, so both files are required.
Keep each .xdmf file together with its matching .h5 file.
- Yoon diffuser:
mesh_yoon_yplus1.xdmf+.h5,cell_yoon_yplus1.xdmf+.h5, andfacet_yoon_yplus1.xdmf+.h5. - Alexandersen pipe bend:
mesh_yplus1.xdmf+.h5andcell_yplus1.xdmf+.h5. - Alexandersen U-bend:
mesh_yplus1.xdmf+.h5andcell_yplus1.xdmf+.h5.
The mesh-generation scripts are stored in the same geometry folders.
Use the solver and configuration from the case list:
cd FluidTO
python3 <solver-file> --config <configuration-file>Prefix the command with mpirun -np <process-count> for an MPI run.
TurbulenceModels/ contains two steady Spalart-Allmaras verification cases separate from topology optimization.
- Channel:
ChannelSimulation_SpalartAllmaras_Steady.py,Configs/ConfigChannel_SpalartAllmaras_Steady.py, andMeshes/Channel/. - U-bend:
UBendSimulation_SpalartAllmaras_Steady.py,Configs/ConfigUBend_SpalartAllmaras_Steady.py, andMeshes/U-Bend/.
Both use TurbulenceModel_SpalartAllmaras.py, SA_Steady_IPCS_Picard_Solver.py, and Utilities.py.