SlideShare ist ein Scribd-Unternehmen logo
1 von 34
An Introduction to My CFD Code
(2D Version)
Jiannan(Jay) Tan
Highlights
• 1. Based on MATLAB.
• 2. Aiming on 2D, Steady, Laminar, viscous
flow.
• 3. Using unstructured, arbitrary-shape,
collocated grids.
• 4. Navier-Stokes equations are solved and
velocity and pressure are calculated.
• 5. Results are compared with those results
from FLUENT.
• 6. A few benchmarking cases are tested.
How does the code work
2D Code
Part 1: Mesh reader Part 2: N-S Equation Solver
Files in certain format
that contains the mesh
information. For
example, the FLUENT
*.msh file.
Velocity filed U, V and
Pressure P.
Part 3: Post-processing
sub-programs
Visualized vector plots
and contours.
The Data structure of Mesh
U,V,P
B(xb, yb)
A(xa, ya)
C(xc, yc)
4.Face normal
Cell ID = P
1. Point ID (x, y)
2. Face ID (A, B, P, nb, property )
3. Cell ID (3, face1, face2, face3)
3 elemental data groups
which decide the whole
mesh:
1.Flow flux
3.Face area
6.Volume
7.Presssure gradient
2.Face velocity components
5.Face velocity components’ gradient
7 important variables:
The N-S Euqation Solver
( ) ( ( ))U P
t
ρ µ
∂Φ
+ ∇× Φ = ∇× ∇Φ −∇
∂
uv
( ) 0Uρ∇× =
uv
Momentum
equation:
Continuity
equation:
1. Discretization: Gauss Theorem
2. Face Mass Flux and Face Scalar
3. SIMPLE Method
4. Least Square Method
5. Pressure-Correction Equation
6. Convergence Criteria
Steady flow
Methodology-SIMPLE Method
Initial guess of u, v and p
Solving the dicretized momentum
equations and get interim velocity u, v
Calculating the face mass flux using
momentum interpolation method
Solving the discretized continuity
equation and geting the pressure
correction p’
Correcting the cell-central pressure
and velocity
Convergence reached?
Post-processing
Resuming
iteration with
new u, v and p
Discretizing Momentum Equations
Using Gauss Theorem
ˆˆ( ) ( ( ))U n ds n ds P Vρ µ ∆Φ × × = ∇× ∇Φ × × −∇ ×∫ ∫
uv
( ) ( ( ))U dv dv P dvρ µ∇× Φ × = ∇× ∇Φ × − ∇ ×∫ ∫ ∫
uv
( ) ( ( ))U Pρ µ∇× Φ = ∇× ∇Φ −∇
uv
. .
( ) [ ( ) ]n d E P Cross
nb face nb face
F D D P V∆×Φ = × Φ − Φ + −∇ ×∑ ∑
1
.
( ) [ ] ( )n n n
p p e e p
nb face
a a S P V −
∆×Φ = ×Φ + − ∇ ×∑
Interim velocity u, v
MIM
Pressure-Correcton Equation
.
.
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
u
p e e nb nb e u e P E e
nb face
v
p e e nb nb e v e P E e
nb face
a u a u S P P y
a v a v S P P x
∆
∆
× = × + + − ×
× = × + − − ×
∑
∑
.
.
( ) ( )
( )
( ) ( )
( ) ( )
( )
( ) ( )
nb nb e u e
nb face e
e P Eu u
p e p e
nb nb e v e
nb face e
e P Ev v
p e p e
a u S
y
u P P
a a
a v S
x
v P P
a a
∆
∆
× +
= + − ×
× +
= − − ×
∑
∑
' ' '
' ' '
( )
( )
( )
( )
e
e P E u
p e
e
e P e v
p e
y
u P P
a
x
v P P
a
∆
∆
= − ×
= − − ×
* * ' '
1
[( ) ( ) ( ) ( ) ] 0
Nb
e e e e
e
u y v x u y v xρ ρ ρ ρ∆ ∆ ∆ ∆
=
− + − =∑
Continuity Equation,
assume u=u’+u*
2 2
' ' ' '
1
[( )( ) ( ) ( ) ] 0
Nb
P E e eu v
e P P
y x
P P u y v x
a a
ρ ρ
ρ ρ∆ ∆
∆ ∆
=
+ − + − =∑
' '
1
( ) . . . . .
Nb
P P E E
e
a P a P Mass imbalance in to cell P
=
= +∑
Momentum Interpolation Method
1. Used after interim velocity is achieved after solving
momentum equations.
2. Applied in order to eliminate oscillating pressure field.
Sometimes called ‘pressure smooth term’.
3. Used to calculate mass imbalance into each cell in this
code.
Least Square Method
Backup slide: A failed try using LSM
Covergence Criteria
• The ratio of Maximum imbalance rate into a
single cell over the inlet mass flow rate
Validation & Verification
1. Straight pipe flow
2. Jet flow
3. Flow around a cube
4. Z-pipe flow
Test Case 1: Flow in a straight channel
Case 1: FLUENT solution
U(max)=1.47
Test Case 1: Flow in a straight channel
U(max)=1.46
Test Case 2: Sudden Expansion-Jet
Flow
Case 2: FLUENT solution: Velocity vector
U(max)=1.33
Case 2: FLUENT solution: Vortex pattern
Test Case 2: My code solution
U(max)=1.34
Case 2: Comparison of vortex length
Test case 3: Flow in a Z-pipe
Case 3: FLUENT solution: Velocity vector
U(max)=1.44
Case 3: FLUENT solution: Vortex pattern
Test case 3: My code solution
U(max)=1.44
Case 3: Comparison of vortex length
Test case 4: Flow past a square cylinder
Case 4: FLUENT solution: Velocity vector
U(max)=1.43
Case 4: FLUENT solution: Vortex pattern
Test case 4: My code solution
U(max)=1.41
Case 4: Comparison of vortex length
Case 4: Comparison of Cd
FLUENT My Code
Pressure Force 1.275 1.299
Viscous Force 0.601 0.541
Total Force 1.876 1.840
Cd 3.752 3.680
Density =1, viscosity =0.05, Frontal area =1, U=1
Backup slide: Case 4 FLUENT report
Futher Development
• 1. Optimization
• 2. Different methods to dicretized the momentum euqation.
• 3. Different methods to calculate the pressure gradient.
• 4. Different methods to do the iteration.
• 5. Parallel computation.
• 6. Mesh generator.
• 7. More advanced models.
• 8. Advanced post-processor.
• 9. Commercialize the code, sell it to MATLAB :-D

Weitere ähnliche Inhalte

Was ist angesagt?

Chapter5
Chapter5Chapter5
Chapter5telmanm
 
Introduction to Mass Transfer Operations (3 of 5)
Introduction to Mass Transfer Operations (3 of 5)Introduction to Mass Transfer Operations (3 of 5)
Introduction to Mass Transfer Operations (3 of 5)Chemical Engineering Guy
 
Transient Heat-conduction-Part-II
Transient Heat-conduction-Part-IITransient Heat-conduction-Part-II
Transient Heat-conduction-Part-IItmuliya
 
Chemical Reaction Engineering
Chemical Reaction EngineeringChemical Reaction Engineering
Chemical Reaction EngineeringMujeeb UR Rahman
 
CFD Introduction using Ansys Fluent
CFD Introduction using Ansys FluentCFD Introduction using Ansys Fluent
CFD Introduction using Ansys Fluentsavani4611
 
CFD Modeling of Multiphase Flow. Focus on Liquid-Solid Flow
CFD Modeling of Multiphase Flow. Focus on Liquid-Solid FlowCFD Modeling of Multiphase Flow. Focus on Liquid-Solid Flow
CFD Modeling of Multiphase Flow. Focus on Liquid-Solid FlowLuis Ram Rojas-Sol
 
Material & Energy Balance for Distillation
Material & Energy Balance for DistillationMaterial & Energy Balance for Distillation
Material & Energy Balance for DistillationPankaj Khandelwal
 
Non-equilibrium molecular dynamics with LAMMPS
Non-equilibrium molecular dynamics with LAMMPSNon-equilibrium molecular dynamics with LAMMPS
Non-equilibrium molecular dynamics with LAMMPSAndrea Benassi
 
FLUID MECHANICS - COMPUTATIONAL FLUID DYNAMICS (CFD)
FLUID MECHANICS - COMPUTATIONAL FLUID DYNAMICS (CFD)FLUID MECHANICS - COMPUTATIONAL FLUID DYNAMICS (CFD)
FLUID MECHANICS - COMPUTATIONAL FLUID DYNAMICS (CFD)YOGESH AHIRE
 
PMS Chemical Engineering Notes
PMS Chemical Engineering NotesPMS Chemical Engineering Notes
PMS Chemical Engineering NotesTrivendraSingh13
 
Absorption Column: Foundations, Applications and Scientific Progress
Absorption Column: Foundations, Applications and Scientific ProgressAbsorption Column: Foundations, Applications and Scientific Progress
Absorption Column: Foundations, Applications and Scientific ProgressAngel Darío González-Delgado
 
Dimensionless number in chemical engineering
Dimensionless number in chemical engineering Dimensionless number in chemical engineering
Dimensionless number in chemical engineering Hardi Trivedi
 
Numerical methods for 2 d heat transfer
Numerical methods for 2 d heat transferNumerical methods for 2 d heat transfer
Numerical methods for 2 d heat transferArun Sarasan
 

Was ist angesagt? (20)

Chapter5
Chapter5Chapter5
Chapter5
 
Introduction to Mass Transfer Operations (3 of 5)
Introduction to Mass Transfer Operations (3 of 5)Introduction to Mass Transfer Operations (3 of 5)
Introduction to Mass Transfer Operations (3 of 5)
 
Transient Heat-conduction-Part-II
Transient Heat-conduction-Part-IITransient Heat-conduction-Part-II
Transient Heat-conduction-Part-II
 
Design of condenser
Design of condenserDesign of condenser
Design of condenser
 
conversion and reactor sizing
conversion and reactor sizingconversion and reactor sizing
conversion and reactor sizing
 
Single effect evaporation
Single effect evaporationSingle effect evaporation
Single effect evaporation
 
Chemical Reaction Engineering
Chemical Reaction EngineeringChemical Reaction Engineering
Chemical Reaction Engineering
 
Reflux ratio
Reflux ratioReflux ratio
Reflux ratio
 
CFD Introduction using Ansys Fluent
CFD Introduction using Ansys FluentCFD Introduction using Ansys Fluent
CFD Introduction using Ansys Fluent
 
CFD Modeling of Multiphase Flow. Focus on Liquid-Solid Flow
CFD Modeling of Multiphase Flow. Focus on Liquid-Solid FlowCFD Modeling of Multiphase Flow. Focus on Liquid-Solid Flow
CFD Modeling of Multiphase Flow. Focus on Liquid-Solid Flow
 
bubble point calculations
bubble point calculationsbubble point calculations
bubble point calculations
 
Material & Energy Balance for Distillation
Material & Energy Balance for DistillationMaterial & Energy Balance for Distillation
Material & Energy Balance for Distillation
 
Non-equilibrium molecular dynamics with LAMMPS
Non-equilibrium molecular dynamics with LAMMPSNon-equilibrium molecular dynamics with LAMMPS
Non-equilibrium molecular dynamics with LAMMPS
 
Jacketed vessel design
Jacketed vessel designJacketed vessel design
Jacketed vessel design
 
FLUID MECHANICS - COMPUTATIONAL FLUID DYNAMICS (CFD)
FLUID MECHANICS - COMPUTATIONAL FLUID DYNAMICS (CFD)FLUID MECHANICS - COMPUTATIONAL FLUID DYNAMICS (CFD)
FLUID MECHANICS - COMPUTATIONAL FLUID DYNAMICS (CFD)
 
PMS Chemical Engineering Notes
PMS Chemical Engineering NotesPMS Chemical Engineering Notes
PMS Chemical Engineering Notes
 
Absorption Column: Foundations, Applications and Scientific Progress
Absorption Column: Foundations, Applications and Scientific ProgressAbsorption Column: Foundations, Applications and Scientific Progress
Absorption Column: Foundations, Applications and Scientific Progress
 
Rotary Dryer Sizing and Design
Rotary Dryer Sizing and DesignRotary Dryer Sizing and Design
Rotary Dryer Sizing and Design
 
Dimensionless number in chemical engineering
Dimensionless number in chemical engineering Dimensionless number in chemical engineering
Dimensionless number in chemical engineering
 
Numerical methods for 2 d heat transfer
Numerical methods for 2 d heat transferNumerical methods for 2 d heat transfer
Numerical methods for 2 d heat transfer
 

Andere mochten auch

Fluent and Gambit Workshop
Fluent and Gambit WorkshopFluent and Gambit Workshop
Fluent and Gambit Workshopkhalid_nitt
 
Computational Fluid Dynamics (CFD)
Computational Fluid Dynamics (CFD)Computational Fluid Dynamics (CFD)
Computational Fluid Dynamics (CFD)Taani Saxena
 
ANSYS Fluent - CFD Final year thesis
ANSYS Fluent - CFD Final year thesisANSYS Fluent - CFD Final year thesis
ANSYS Fluent - CFD Final year thesisDibyajyoti Laha
 
Lid driven cavity flow simulation using CFD & MATLAB
Lid driven cavity flow simulation using CFD & MATLABLid driven cavity flow simulation using CFD & MATLAB
Lid driven cavity flow simulation using CFD & MATLABIJSRD
 
Computational Fluid Dynamics (CFD)
Computational Fluid Dynamics (CFD)Computational Fluid Dynamics (CFD)
Computational Fluid Dynamics (CFD)Khusro Kamaluddin
 
fluent tutorial guide (Ansys)
fluent tutorial guide (Ansys)fluent tutorial guide (Ansys)
fluent tutorial guide (Ansys)A.S.M. Abdul Hye
 
CFD : Modern Applications, Challenges and Future Trends
CFD : Modern Applications, Challenges and Future Trends CFD : Modern Applications, Challenges and Future Trends
CFD : Modern Applications, Challenges and Future Trends Dr. Khalid Saqr
 
CFD analysis of aerofoil
CFD analysis of aerofoilCFD analysis of aerofoil
CFD analysis of aerofoilNeel Thakkar
 
CFD analysis of Flow across an Aerofoil
CFD analysis of Flow across an AerofoilCFD analysis of Flow across an Aerofoil
CFD analysis of Flow across an AerofoilJJ Technical Solutions
 
Basics on airfoils and lift generation
Basics on airfoils and lift generationBasics on airfoils and lift generation
Basics on airfoils and lift generationmayawwo
 
Pressure velocity coupling
Pressure velocity couplingPressure velocity coupling
Pressure velocity couplingparabajinkya0070
 
Cfd introduction
Cfd introductionCfd introduction
Cfd introductionSantosh V
 
Airfoil terminology
Airfoil terminologyAirfoil terminology
Airfoil terminologySmart Vino
 
Computational fluid dynamics approach, conservation equations and
Computational fluid dynamics approach, conservation equations andComputational fluid dynamics approach, conservation equations and
Computational fluid dynamics approach, conservation equations andlavarchanamn
 
Computational fluid dynamics
Computational fluid dynamicsComputational fluid dynamics
Computational fluid dynamicsRavi Choudhary
 
UAV Presentation
UAV PresentationUAV Presentation
UAV PresentationRuyyan
 

Andere mochten auch (20)

Fluent and Gambit Workshop
Fluent and Gambit WorkshopFluent and Gambit Workshop
Fluent and Gambit Workshop
 
CFD analysis of an Airfoil
CFD analysis of an AirfoilCFD analysis of an Airfoil
CFD analysis of an Airfoil
 
Computational Fluid Dynamics (CFD)
Computational Fluid Dynamics (CFD)Computational Fluid Dynamics (CFD)
Computational Fluid Dynamics (CFD)
 
ANSYS Fluent - CFD Final year thesis
ANSYS Fluent - CFD Final year thesisANSYS Fluent - CFD Final year thesis
ANSYS Fluent - CFD Final year thesis
 
Lid driven cavity flow simulation using CFD & MATLAB
Lid driven cavity flow simulation using CFD & MATLABLid driven cavity flow simulation using CFD & MATLAB
Lid driven cavity flow simulation using CFD & MATLAB
 
CFD & ANSYS FLUENT
CFD & ANSYS FLUENTCFD & ANSYS FLUENT
CFD & ANSYS FLUENT
 
Computational Fluid Dynamics (CFD)
Computational Fluid Dynamics (CFD)Computational Fluid Dynamics (CFD)
Computational Fluid Dynamics (CFD)
 
fluent tutorial guide (Ansys)
fluent tutorial guide (Ansys)fluent tutorial guide (Ansys)
fluent tutorial guide (Ansys)
 
CFD : Modern Applications, Challenges and Future Trends
CFD : Modern Applications, Challenges and Future Trends CFD : Modern Applications, Challenges and Future Trends
CFD : Modern Applications, Challenges and Future Trends
 
CFD analysis of aerofoil
CFD analysis of aerofoilCFD analysis of aerofoil
CFD analysis of aerofoil
 
Introduction to cfd
Introduction to cfdIntroduction to cfd
Introduction to cfd
 
CFD analysis of Flow across an Aerofoil
CFD analysis of Flow across an AerofoilCFD analysis of Flow across an Aerofoil
CFD analysis of Flow across an Aerofoil
 
Basics on airfoils and lift generation
Basics on airfoils and lift generationBasics on airfoils and lift generation
Basics on airfoils and lift generation
 
Pressure velocity coupling
Pressure velocity couplingPressure velocity coupling
Pressure velocity coupling
 
Cfd introduction
Cfd introductionCfd introduction
Cfd introduction
 
Airfoil terminology
Airfoil terminologyAirfoil terminology
Airfoil terminology
 
Basic aerodynamics
Basic aerodynamicsBasic aerodynamics
Basic aerodynamics
 
Computational fluid dynamics approach, conservation equations and
Computational fluid dynamics approach, conservation equations andComputational fluid dynamics approach, conservation equations and
Computational fluid dynamics approach, conservation equations and
 
Computational fluid dynamics
Computational fluid dynamicsComputational fluid dynamics
Computational fluid dynamics
 
UAV Presentation
UAV PresentationUAV Presentation
UAV Presentation
 

Ähnlich wie 2D CFD Code Based on MATLAB- As Good As FLUENT!

A 1 D Breakup Model For
A 1 D Breakup Model ForA 1 D Breakup Model For
A 1 D Breakup Model ForAnupam Dhyani
 
Identification of the Mathematical Models of Complex Relaxation Processes in ...
Identification of the Mathematical Models of Complex Relaxation Processes in ...Identification of the Mathematical Models of Complex Relaxation Processes in ...
Identification of the Mathematical Models of Complex Relaxation Processes in ...Vladimir Bakhrushin
 
Numerical Methods
Numerical MethodsNumerical Methods
Numerical MethodsTeja Ande
 
Newton Raphson method for load flow analysis
Newton Raphson method for load flow analysisNewton Raphson method for load flow analysis
Newton Raphson method for load flow analysisdivyanshuprakashrock
 
Delayed acceptance for Metropolis-Hastings algorithms
Delayed acceptance for Metropolis-Hastings algorithmsDelayed acceptance for Metropolis-Hastings algorithms
Delayed acceptance for Metropolis-Hastings algorithmsChristian Robert
 
Numerical differentation with c
Numerical differentation with cNumerical differentation with c
Numerical differentation with cYagya Dev Bhardwaj
 
Discretization of a Mathematical Model for Tumor-Immune System Interaction wi...
Discretization of a Mathematical Model for Tumor-Immune System Interaction wi...Discretization of a Mathematical Model for Tumor-Immune System Interaction wi...
Discretization of a Mathematical Model for Tumor-Immune System Interaction wi...mathsjournal
 
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...mathsjournal
 
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...mathsjournal
 
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...mathsjournal
 
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...mathsjournal
 
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...mathsjournal
 
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...mathsjournal
 

Ähnlich wie 2D CFD Code Based on MATLAB- As Good As FLUENT! (20)

A 1 D Breakup Model For
A 1 D Breakup Model ForA 1 D Breakup Model For
A 1 D Breakup Model For
 
Identification of the Mathematical Models of Complex Relaxation Processes in ...
Identification of the Mathematical Models of Complex Relaxation Processes in ...Identification of the Mathematical Models of Complex Relaxation Processes in ...
Identification of the Mathematical Models of Complex Relaxation Processes in ...
 
pRO
pROpRO
pRO
 
05_AJMS_332_21.pdf
05_AJMS_332_21.pdf05_AJMS_332_21.pdf
05_AJMS_332_21.pdf
 
Numerical Methods
Numerical MethodsNumerical Methods
Numerical Methods
 
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
 
Technical
TechnicalTechnical
Technical
 
Newton Raphson method for load flow analysis
Newton Raphson method for load flow analysisNewton Raphson method for load flow analysis
Newton Raphson method for load flow analysis
 
Delayed acceptance for Metropolis-Hastings algorithms
Delayed acceptance for Metropolis-Hastings algorithmsDelayed acceptance for Metropolis-Hastings algorithms
Delayed acceptance for Metropolis-Hastings algorithms
 
9 pd es
9 pd es9 pd es
9 pd es
 
Numerical differentation with c
Numerical differentation with cNumerical differentation with c
Numerical differentation with c
 
presentation
presentationpresentation
presentation
 
ProjectAndersSchreiber
ProjectAndersSchreiberProjectAndersSchreiber
ProjectAndersSchreiber
 
Discretization of a Mathematical Model for Tumor-Immune System Interaction wi...
Discretization of a Mathematical Model for Tumor-Immune System Interaction wi...Discretization of a Mathematical Model for Tumor-Immune System Interaction wi...
Discretization of a Mathematical Model for Tumor-Immune System Interaction wi...
 
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
 
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
 
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
 
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
 
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
 
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
DISCRETIZATION OF A MATHEMATICAL MODEL FOR TUMOR-IMMUNE SYSTEM INTERACTION WI...
 

Kürzlich hochgeladen

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Kürzlich hochgeladen (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

2D CFD Code Based on MATLAB- As Good As FLUENT!

  • 1. An Introduction to My CFD Code (2D Version) Jiannan(Jay) Tan
  • 2. Highlights • 1. Based on MATLAB. • 2. Aiming on 2D, Steady, Laminar, viscous flow. • 3. Using unstructured, arbitrary-shape, collocated grids. • 4. Navier-Stokes equations are solved and velocity and pressure are calculated. • 5. Results are compared with those results from FLUENT. • 6. A few benchmarking cases are tested.
  • 3. How does the code work 2D Code Part 1: Mesh reader Part 2: N-S Equation Solver Files in certain format that contains the mesh information. For example, the FLUENT *.msh file. Velocity filed U, V and Pressure P. Part 3: Post-processing sub-programs Visualized vector plots and contours.
  • 4. The Data structure of Mesh U,V,P B(xb, yb) A(xa, ya) C(xc, yc) 4.Face normal Cell ID = P 1. Point ID (x, y) 2. Face ID (A, B, P, nb, property ) 3. Cell ID (3, face1, face2, face3) 3 elemental data groups which decide the whole mesh: 1.Flow flux 3.Face area 6.Volume 7.Presssure gradient 2.Face velocity components 5.Face velocity components’ gradient 7 important variables:
  • 5. The N-S Euqation Solver ( ) ( ( ))U P t ρ µ ∂Φ + ∇× Φ = ∇× ∇Φ −∇ ∂ uv ( ) 0Uρ∇× = uv Momentum equation: Continuity equation: 1. Discretization: Gauss Theorem 2. Face Mass Flux and Face Scalar 3. SIMPLE Method 4. Least Square Method 5. Pressure-Correction Equation 6. Convergence Criteria Steady flow
  • 6. Methodology-SIMPLE Method Initial guess of u, v and p Solving the dicretized momentum equations and get interim velocity u, v Calculating the face mass flux using momentum interpolation method Solving the discretized continuity equation and geting the pressure correction p’ Correcting the cell-central pressure and velocity Convergence reached? Post-processing Resuming iteration with new u, v and p
  • 7. Discretizing Momentum Equations Using Gauss Theorem ˆˆ( ) ( ( ))U n ds n ds P Vρ µ ∆Φ × × = ∇× ∇Φ × × −∇ ×∫ ∫ uv ( ) ( ( ))U dv dv P dvρ µ∇× Φ × = ∇× ∇Φ × − ∇ ×∫ ∫ ∫ uv ( ) ( ( ))U Pρ µ∇× Φ = ∇× ∇Φ −∇ uv . . ( ) [ ( ) ]n d E P Cross nb face nb face F D D P V∆×Φ = × Φ − Φ + −∇ ×∑ ∑ 1 . ( ) [ ] ( )n n n p p e e p nb face a a S P V − ∆×Φ = ×Φ + − ∇ ×∑ Interim velocity u, v MIM
  • 8. Pressure-Correcton Equation . . ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) u p e e nb nb e u e P E e nb face v p e e nb nb e v e P E e nb face a u a u S P P y a v a v S P P x ∆ ∆ × = × + + − × × = × + − − × ∑ ∑ . . ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) nb nb e u e nb face e e P Eu u p e p e nb nb e v e nb face e e P Ev v p e p e a u S y u P P a a a v S x v P P a a ∆ ∆ × + = + − × × + = − − × ∑ ∑ ' ' ' ' ' ' ( ) ( ) ( ) ( ) e e P E u p e e e P e v p e y u P P a x v P P a ∆ ∆ = − × = − − × * * ' ' 1 [( ) ( ) ( ) ( ) ] 0 Nb e e e e e u y v x u y v xρ ρ ρ ρ∆ ∆ ∆ ∆ = − + − =∑ Continuity Equation, assume u=u’+u* 2 2 ' ' ' ' 1 [( )( ) ( ) ( ) ] 0 Nb P E e eu v e P P y x P P u y v x a a ρ ρ ρ ρ∆ ∆ ∆ ∆ = + − + − =∑ ' ' 1 ( ) . . . . . Nb P P E E e a P a P Mass imbalance in to cell P = = +∑
  • 9. Momentum Interpolation Method 1. Used after interim velocity is achieved after solving momentum equations. 2. Applied in order to eliminate oscillating pressure field. Sometimes called ‘pressure smooth term’. 3. Used to calculate mass imbalance into each cell in this code.
  • 11. Backup slide: A failed try using LSM
  • 12. Covergence Criteria • The ratio of Maximum imbalance rate into a single cell over the inlet mass flow rate
  • 13. Validation & Verification 1. Straight pipe flow 2. Jet flow 3. Flow around a cube 4. Z-pipe flow
  • 14. Test Case 1: Flow in a straight channel
  • 15. Case 1: FLUENT solution U(max)=1.47
  • 16. Test Case 1: Flow in a straight channel U(max)=1.46
  • 17. Test Case 2: Sudden Expansion-Jet Flow
  • 18. Case 2: FLUENT solution: Velocity vector U(max)=1.33
  • 19. Case 2: FLUENT solution: Vortex pattern
  • 20. Test Case 2: My code solution U(max)=1.34
  • 21. Case 2: Comparison of vortex length
  • 22. Test case 3: Flow in a Z-pipe
  • 23. Case 3: FLUENT solution: Velocity vector U(max)=1.44
  • 24. Case 3: FLUENT solution: Vortex pattern
  • 25. Test case 3: My code solution U(max)=1.44
  • 26. Case 3: Comparison of vortex length
  • 27. Test case 4: Flow past a square cylinder
  • 28. Case 4: FLUENT solution: Velocity vector U(max)=1.43
  • 29. Case 4: FLUENT solution: Vortex pattern
  • 30. Test case 4: My code solution U(max)=1.41
  • 31. Case 4: Comparison of vortex length
  • 32. Case 4: Comparison of Cd FLUENT My Code Pressure Force 1.275 1.299 Viscous Force 0.601 0.541 Total Force 1.876 1.840 Cd 3.752 3.680 Density =1, viscosity =0.05, Frontal area =1, U=1
  • 33. Backup slide: Case 4 FLUENT report
  • 34. Futher Development • 1. Optimization • 2. Different methods to dicretized the momentum euqation. • 3. Different methods to calculate the pressure gradient. • 4. Different methods to do the iteration. • 5. Parallel computation. • 6. Mesh generator. • 7. More advanced models. • 8. Advanced post-processor. • 9. Commercialize the code, sell it to MATLAB :-D