Agentic CFD Workflow
Inspiration
Engineers spend weeks manually iterating on CFD simulations to optimize designs. What if an AI agent could autonomously orchestrate the entire workflow—generating geometries, running simulations, analyzing results, and proposing better candidates?
What it does
An autonomous CFD optimization system powered by AWS Bedrock Agent that orchestrates multiple Lambda-based tools through intelligent decision-making:
- Generates NACA airfoil geometries from design parameters
- Simulates aerodynamics using physics-based models (mock CFD)
- Optimizes designs using trust-region algorithms
- Converges automatically when improvement plateaus
- Reports comprehensive optimization summaries
The agent runs 5-8 iterations autonomously, minimizing drag while maintaining lift constraints—all managed by a Step Functions workflow with zero human intervention.
How we built it
Architecture: Bedrock Agent → Step Functions → 7 Lambda Functions → S3 Storage
Tech Stack:
- AWS Bedrock Agent (Claude 3 Sonnet) for intelligent orchestration
- AWS Step Functions for autonomous loop management
- AWS Lambda (Python 3.12) for tool implementations
- S3 for session-based data persistence
- AWS CDK for infrastructure-as-code
Key Components:
Agent Tools (3 Lambdas):
generate_geometry- Creates airfoil designs from NACA parametersrun_cfd- Simulates lift/drag coefficientsget_next_candidates- Proposes optimized designs using trust-region strategy
Orchestration (4 Lambdas):
initialize_optimization- Creates S3 session with unique IDinvoke_bedrock_agent- Wraps agent API for Step Functionscheck_convergence- Detects when improvement < 0.5%generate_report- Summarizes optimization trajectory
State Machine - Manages iteration loops with safety limits and error handling
Challenges we ran into
- Bedrock Agent Event Format - Spent 2 hours debugging nested parameter structures unique to Bedrock
- Rate Limiting - Aggressive Bedrock throttling required exponential backoff and careful testing
- IAM Permissions - Agent role needed explicit
bedrock:InvokeModelpermission not in docs - Agent Reasoning Reliability - Initial failures were actually mock data quality issues, not orchestration
- State Management - Designing iteration counters in Step Functions to prevent infinite loops
- Zero Dependencies - Lambda constraints required pure Python CSV parsing instead of Pandas
Accomplishments that we're proud of
Full Autonomy - System runs 5+ iterations without human intervention
Intelligent Orchestration - Agent makes smart decisions about exploration vs exploitation
What we learned
- Agent orchestration is the hard part - Once proven, swapping mock tools for real CFD is straightforward
- Prompt engineering is critical - Agent decision quality depends heavily on tool descriptions and system prompts
- Event formats vary by service - Always check AWS docs for exact schemas
- Design for swappability - Interface stability matters more than implementation details
- Rate limits are real - Test throttling behavior early, not during demos
- State machines are powerful - Step Functions provides elegant loop management with built-in retry logic
What's next for Agentic CFD Workflow
Immediate:
- CLI interface with live progress visualization (Day 4)
- Replace S3 with DynamoDB for structured queries
- Add CloudWatch dashboards for monitoring
Real CFD Integration:
- Swap
generate_geometrywith gmsh/Construct2D mesh generation - Replace
run_cfdmock with SU2/OpenFOAM simulations - Integrate AWS Batch for parallel CFD runs
- Add Docker containers for solver environments
Advanced Features:
- Surrogate modeling for faster convergence
- Multi-objective optimization (minimize drag AND cost)
- Multi-fidelity workflows (coarse → fine mesh)
- 3D geometry optimization
- Integration with CAD systems
Production Readiness:
- Cost optimization (spot instances, preemptible compute)
- SNS notifications on completion/failure
- Web dashboard for result visualization
- Team collaboration features
The Vision: Make CFD optimization accessible to engineers who don't have weeks to manually iterate. Let AI handle the tedious orchestration while humans focus on high-level design decisions.
Built With
- amazon-web-services
- bedrock
- cdk
- cloudformation
- cloudwatch
- lambda
- python
- s3
- state-machine
Log in or sign up for Devpost to join the conversation.