[302.044] numerical methods in fluid dynamics 2–d cylinder

31
[302.044] Numerical Methods in Fluid Dynamics 2D Cylinder Potential Flow ( potentialFoam ), NonOrthogonal Correction and Curved Mesh Univ. Assist. MSc. Francesco Roman [email protected] December 18th, 2014

Upload: others

Post on 14-Apr-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

[302.044] Numerical Methodsin Fluid Dynamics

2–D CylinderPotential Flow (potentialFoam),

Non–Orthogonal Correction and Curved Mesh

Univ. Assist. MSc. Francesco Romanò

[email protected]

December 18th, 2014

Page 2: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 3: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 4: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 5: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 6: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 7: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 8: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 9: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 10: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 11: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 12: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 13: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 14: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 15: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 16: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 17: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 18: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 19: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 20: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 21: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 22: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 23: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 24: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 25: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 26: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 27: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 28: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 29: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 30: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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

Page 31: [302.044] Numerical Methods in Fluid Dynamics 2–D Cylinder

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