[302.044] Numerical Methodsin Fluid Dynamics
2–D CylinderPotential Flow (potentialFoam),
Non–Orthogonal Correction and Curved Mesh
Univ. Assist. MSc. Francesco Romanò
December 18th, 2014
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
Outline
1 Potential Flow
2 2–D Cylinder
3 potentialFoamMeshingSolver Set-upAnalytical Solution
[302.044] – Univ. Assist. MSc. Francesco Romanò 2/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
Potential Flow Equations
Potential Flow Equations
∇ · u = 0
∆p = 0
+BC & IC
u = velocity field;p = relative pressure field;
[302.044] – Univ. Assist. MSc. Francesco Romanò 3/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
Potential Flow Equations
Potential Flow Equations∇ · u = 0
∆p = 0
+BC & IC
u = velocity field;p = relative pressure field;
[302.044] – Univ. Assist. MSc. Francesco Romanò 3/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
Potential Flow Equations
Potential Flow Equations∇ · u = 0
∆p = 0
+BC & IC
u = velocity field;p = relative pressure field;
[302.044] – Univ. Assist. MSc. Francesco Romanò 3/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderMathematical Problem
2–D Cylinder Problem
∇ · u = 0
∆p = 0
BC :
left edge: Inlet → u = 1 i m/s;right edge: Outlet → p = 0;
bottom edge: Symmetry;
top edge: No–Slip → u = 0;
IC : u = 0 , (p = 0);
u = velocity field;p = relative pressure field;
[302.044] – Univ. Assist. MSc. Francesco Romanò 4/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderMathematical Problem
2–D Cylinder Problem
∇ · u = 0
∆p = 0
BC :
left edge: Inlet → u = 1 i m/s;right edge: Outlet → p = 0;
bottom edge: Symmetry;
top edge: No–Slip → u = 0;
IC : u = 0 , (p = 0);
u = velocity field;p = relative pressure field;
[302.044] – Univ. Assist. MSc. Francesco Romanò 4/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver
. potentialFoam assumes an incompressible, steady,irrotational flow and ignores gravity;
. Because an exact solution of the analysed problem is wellknown, it is possible to validate the code throughout acomparison between numerical and analytical solutions;
. potentialFoam can be used as an efficient solver forinitializing more complex ones as icoFoam. Indeed, e.g.,instead of starting from resting flow past a cylinder, thecurrent numerical solution can be used as initial guess forthe simulation of a von Karman street instabilityphenomenon.
[302.044] – Univ. Assist. MSc. Francesco Romanò 5/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver. potentialFoam assumes an incompressible, steady,
irrotational flow and ignores gravity;
. Because an exact solution of the analysed problem is wellknown, it is possible to validate the code throughout acomparison between numerical and analytical solutions;
. potentialFoam can be used as an efficient solver forinitializing more complex ones as icoFoam. Indeed, e.g.,instead of starting from resting flow past a cylinder, thecurrent numerical solution can be used as initial guess forthe simulation of a von Karman street instabilityphenomenon.
[302.044] – Univ. Assist. MSc. Francesco Romanò 5/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver. potentialFoam assumes an incompressible, steady,
irrotational flow and ignores gravity;
. Because an exact solution of the analysed problem is wellknown, it is possible to validate the code throughout acomparison between numerical and analytical solutions;
. potentialFoam can be used as an efficient solver forinitializing more complex ones as icoFoam. Indeed, e.g.,instead of starting from resting flow past a cylinder, thecurrent numerical solution can be used as initial guess forthe simulation of a von Karman street instabilityphenomenon.
[302.044] – Univ. Assist. MSc. Francesco Romanò 5/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver. potentialFoam assumes an incompressible, steady,
irrotational flow and ignores gravity;
. Because an exact solution of the analysed problem is wellknown, it is possible to validate the code throughout acomparison between numerical and analytical solutions;
. potentialFoam can be used as an efficient solver forinitializing more complex ones as icoFoam. Indeed, e.g.,instead of starting from resting flow past a cylinder, thecurrent numerical solution can be used as initial guess forthe simulation of a von Karman street instabilityphenomenon.
[302.044] – Univ. Assist. MSc. Francesco Romanò 5/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: Meshing
. As mesh, a very coarse non-orthogonal one is employed:
. Algorithm steps:
◦ create the geometry writing the blockMeshDict file andlocating it in <problem_folder>/constant/polyMesh/;
◦ the blockMesh command will be included in the./Allrun one.
[302.044] – Univ. Assist. MSc. Francesco Romanò 6/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: Meshing. As mesh, a very coarse non-orthogonal one is employed:
. Algorithm steps:
◦ create the geometry writing the blockMeshDict file andlocating it in <problem_folder>/constant/polyMesh/;
◦ the blockMesh command will be included in the./Allrun one.
[302.044] – Univ. Assist. MSc. Francesco Romanò 6/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: Meshing. As mesh, a very coarse non-orthogonal one is employed:
. Algorithm steps:
◦ create the geometry writing the blockMeshDict file andlocating it in <problem_folder>/constant/polyMesh/;
◦ the blockMesh command will be included in the./Allrun one.
[302.044] – Univ. Assist. MSc. Francesco Romanò 6/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: Meshing. As mesh, a very coarse non-orthogonal one is employed:
. Algorithm steps:
◦ create the geometry writing the blockMeshDict file andlocating it in <problem_folder>/constant/polyMesh/;
◦ the blockMesh command will be included in the./Allrun one.
[302.044] – Univ. Assist. MSc. Francesco Romanò 6/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: Meshing. As mesh, a very coarse non-orthogonal one is employed:
. Algorithm steps:
◦ create the geometry writing the blockMeshDict file andlocating it in <problem_folder>/constant/polyMesh/;
◦ the blockMesh command will be included in the./Allrun one.
[302.044] – Univ. Assist. MSc. Francesco Romanò 6/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: solver set-up
. For an incompressible, irrotational flow there is no necessityto specify physical properties of the fluid;
. In writing the controlDict file, the ∆t is set to 1s. Sincesteady flow is assumed, the transient to the steady statecondition is not physically meaningful;
. Because the employed grid is Non-Orthogonal, the flagnNonOrthogonalCorrectors in fvSolution is set to 3.This implies that 3 outer loop over the pressure equation areprovided. Their effect is to reduce the estimation errors inthe laplacian operator due to the non-orthogonality of themesh;
. To notice the effect of such a correction, two differentsolutions are computed: the first within thenNonOrthogonalCorrectors, the second without.
[302.044] – Univ. Assist. MSc. Francesco Romanò 7/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: solver set-up. For an incompressible, irrotational flow there is no necessity
to specify physical properties of the fluid;
. In writing the controlDict file, the ∆t is set to 1s. Sincesteady flow is assumed, the transient to the steady statecondition is not physically meaningful;
. Because the employed grid is Non-Orthogonal, the flagnNonOrthogonalCorrectors in fvSolution is set to 3.This implies that 3 outer loop over the pressure equation areprovided. Their effect is to reduce the estimation errors inthe laplacian operator due to the non-orthogonality of themesh;
. To notice the effect of such a correction, two differentsolutions are computed: the first within thenNonOrthogonalCorrectors, the second without.
[302.044] – Univ. Assist. MSc. Francesco Romanò 7/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: solver set-up. For an incompressible, irrotational flow there is no necessity
to specify physical properties of the fluid;
. In writing the controlDict file, the ∆t is set to 1s. Sincesteady flow is assumed, the transient to the steady statecondition is not physically meaningful;
. Because the employed grid is Non-Orthogonal, the flagnNonOrthogonalCorrectors in fvSolution is set to 3.This implies that 3 outer loop over the pressure equation areprovided. Their effect is to reduce the estimation errors inthe laplacian operator due to the non-orthogonality of themesh;
. To notice the effect of such a correction, two differentsolutions are computed: the first within thenNonOrthogonalCorrectors, the second without.
[302.044] – Univ. Assist. MSc. Francesco Romanò 7/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: solver set-up. For an incompressible, irrotational flow there is no necessity
to specify physical properties of the fluid;
. In writing the controlDict file, the ∆t is set to 1s. Sincesteady flow is assumed, the transient to the steady statecondition is not physically meaningful;
. Because the employed grid is Non-Orthogonal, the flagnNonOrthogonalCorrectors in fvSolution is set to 3.This implies that 3 outer loop over the pressure equation areprovided. Their effect is to reduce the estimation errors inthe laplacian operator due to the non-orthogonality of themesh;
. To notice the effect of such a correction, two differentsolutions are computed: the first within thenNonOrthogonalCorrectors, the second without.
[302.044] – Univ. Assist. MSc. Francesco Romanò 7/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: solver set-up. For an incompressible, irrotational flow there is no necessity
to specify physical properties of the fluid;
. In writing the controlDict file, the ∆t is set to 1s. Sincesteady flow is assumed, the transient to the steady statecondition is not physically meaningful;
. Because the employed grid is Non-Orthogonal, the flagnNonOrthogonalCorrectors in fvSolution is set to 3.This implies that 3 outer loop over the pressure equation areprovided. Their effect is to reduce the estimation errors inthe laplacian operator due to the non-orthogonality of themesh;
. To notice the effect of such a correction, two differentsolutions are computed: the first within thenNonOrthogonalCorrectors, the second without.
[302.044] – Univ. Assist. MSc. Francesco Romanò 7/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: solver set-up
. Algorithm steps:◦ set the initial conditions writing the p and U files and
locating them in <problem_folder>/0/;◦ set time step and data saving/storing options writing
the controlDict file and locating it in<problem_folder>/system/;
◦ set discretization and splitting scheme details writingthe fvSchemes and fvSolution files and locating themin <problem_folder>/system/;
◦ clean up the folder with the command<problem_folder>$ ./Allclean;
◦ run the mesher and the potentialFoam solver with thecommand <problem_folder>$ ./Allrun;
◦ visualize the results with the command<problem_folder>$ paraFoam.
[302.044] – Univ. Assist. MSc. Francesco Romanò 8/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: solver set-up. Algorithm steps:
◦ set the initial conditions writing the p and U files andlocating them in <problem_folder>/0/;
◦ set time step and data saving/storing options writingthe controlDict file and locating it in<problem_folder>/system/;
◦ set discretization and splitting scheme details writingthe fvSchemes and fvSolution files and locating themin <problem_folder>/system/;
◦ clean up the folder with the command<problem_folder>$ ./Allclean;
◦ run the mesher and the potentialFoam solver with thecommand <problem_folder>$ ./Allrun;
◦ visualize the results with the command<problem_folder>$ paraFoam.
[302.044] – Univ. Assist. MSc. Francesco Romanò 8/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: solver set-up. Algorithm steps:◦ set the initial conditions writing the p and U files and
locating them in <problem_folder>/0/;
◦ set time step and data saving/storing options writingthe controlDict file and locating it in<problem_folder>/system/;
◦ set discretization and splitting scheme details writingthe fvSchemes and fvSolution files and locating themin <problem_folder>/system/;
◦ clean up the folder with the command<problem_folder>$ ./Allclean;
◦ run the mesher and the potentialFoam solver with thecommand <problem_folder>$ ./Allrun;
◦ visualize the results with the command<problem_folder>$ paraFoam.
[302.044] – Univ. Assist. MSc. Francesco Romanò 8/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: solver set-up. Algorithm steps:◦ set the initial conditions writing the p and U files and
locating them in <problem_folder>/0/;◦ set time step and data saving/storing options writing
the controlDict file and locating it in<problem_folder>/system/;
◦ set discretization and splitting scheme details writingthe fvSchemes and fvSolution files and locating themin <problem_folder>/system/;
◦ clean up the folder with the command<problem_folder>$ ./Allclean;
◦ run the mesher and the potentialFoam solver with thecommand <problem_folder>$ ./Allrun;
◦ visualize the results with the command<problem_folder>$ paraFoam.
[302.044] – Univ. Assist. MSc. Francesco Romanò 8/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: solver set-up. Algorithm steps:◦ set the initial conditions writing the p and U files and
locating them in <problem_folder>/0/;◦ set time step and data saving/storing options writing
the controlDict file and locating it in<problem_folder>/system/;
◦ set discretization and splitting scheme details writingthe fvSchemes and fvSolution files and locating themin <problem_folder>/system/;
◦ clean up the folder with the command<problem_folder>$ ./Allclean;
◦ run the mesher and the potentialFoam solver with thecommand <problem_folder>$ ./Allrun;
◦ visualize the results with the command<problem_folder>$ paraFoam.
[302.044] – Univ. Assist. MSc. Francesco Romanò 8/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: solver set-up. Algorithm steps:◦ set the initial conditions writing the p and U files and
locating them in <problem_folder>/0/;◦ set time step and data saving/storing options writing
the controlDict file and locating it in<problem_folder>/system/;
◦ set discretization and splitting scheme details writingthe fvSchemes and fvSolution files and locating themin <problem_folder>/system/;
◦ clean up the folder with the command<problem_folder>$ ./Allclean;
◦ run the mesher and the potentialFoam solver with thecommand <problem_folder>$ ./Allrun;
◦ visualize the results with the command<problem_folder>$ paraFoam.
[302.044] – Univ. Assist. MSc. Francesco Romanò 8/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: solver set-up. Algorithm steps:◦ set the initial conditions writing the p and U files and
locating them in <problem_folder>/0/;◦ set time step and data saving/storing options writing
the controlDict file and locating it in<problem_folder>/system/;
◦ set discretization and splitting scheme details writingthe fvSchemes and fvSolution files and locating themin <problem_folder>/system/;
◦ clean up the folder with the command<problem_folder>$ ./Allclean;
◦ run the mesher and the potentialFoam solver with thecommand <problem_folder>$ ./Allrun;
◦ visualize the results with the command<problem_folder>$ paraFoam.
[302.044] – Univ. Assist. MSc. Francesco Romanò 8/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: solver set-up. Algorithm steps:◦ set the initial conditions writing the p and U files and
locating them in <problem_folder>/0/;◦ set time step and data saving/storing options writing
the controlDict file and locating it in<problem_folder>/system/;
◦ set discretization and splitting scheme details writingthe fvSchemes and fvSolution files and locating themin <problem_folder>/system/;
◦ clean up the folder with the command<problem_folder>$ ./Allclean;
◦ run the mesher and the potentialFoam solver with thecommand <problem_folder>$ ./Allrun;
◦ visualize the results with the command<problem_folder>$ paraFoam.
[302.044] – Univ. Assist. MSc. Francesco Romanò 8/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderOpenFOAM potentialFoam solver
OpenFOAM potentialFoam solver: solver set-up. Case folder structure:
→ <problem_folder>/→ 0/
Up
→ constant/→ polyMesh/
blockMeshDict→ system/
controlDictfvSchemesfvSolution
[302.044] – Univ. Assist. MSc. Francesco Romanò 9/10
PotentialFlow
2–D Cylinder
potentialFoamMeshingSolver Set-upAnalyticalSolution
2–D CylinderAnalytical solution
Analytical solution1
u = U∞
1−
(r
d
)2
cos(2θ)
v = U∞
(r
d
)2
sin(2θ)
d = cylinder diameter;
(r, θ) = polar coordinate from the cylinder centre.
1Assuming infinitely extended boundaries.[302.044] – Univ. Assist. MSc. Francesco Romanò 10/10