Difference between revisions of "Settling Sphere Contact Angle by Michael Alletto"

From OpenFOAM Wiki
Jump to navigation Jump to search
 
(16 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
* '''affiliation''': WRD MS
 
* '''affiliation''': WRD MS
 
* '''contact''': <mail address='michael.alletto@gmx.de' description='author'>click here for email address</mail>
 
* '''contact''': <mail address='michael.alletto@gmx.de' description='author'>click here for email address</mail>
* '''OpenFOAM versions''': v1906
+
* '''OpenFOAM versions''': v2312
 
* '''Published under''': CC BY-NC-ND license ([https://creativecommons.org/licenses creative commons licenses])
 
* '''Published under''': CC BY-NC-ND license ([https://creativecommons.org/licenses creative commons licenses])
  
Line 12: Line 12:
 
=[https://github.com/jnmlujnmlu/OpenFOAMTeaching/tree/master/MichaelAlletto Sphere settling under the influence of gravity with varying contact angle]=
 
=[https://github.com/jnmlujnmlu/OpenFOAMTeaching/tree/master/MichaelAlletto Sphere settling under the influence of gravity with varying contact angle]=
  
You can download the case file [https://github.com/jnmlujnmlu/OpenFOAMTeaching/tree/master/MichaelAlletto sphereSplashSend.tar.gz] here.
+
You can download the case file [https://gitlab.com/mAlletto/openfoamtutorials/-/tree/master/sphereSplashSend] here.
  
 
==Introduction==
 
==Introduction==
  
[[File:setup_alletto.png|650px|right|Setup of the simulation]]
+
In this tutorial the capabilities of the overset methodology of OpenFOAM are further explored. In the previous tutorial a sphere settling under the influence of gravity was simulated (see [https://wiki.openfoam.com/Settling_Sphere_by_Michael_Alletto this tutorial for more information].
  
This tutorial has two main objectives:
+
It was shown, that the temporal evolution of the displacement and the velocity of a sphere settling in a viscous fluid is well captured. This means that the viscous and pressure forces integrated over the sphere surface are well captured. Furthermore it also means that the interpolation errors introduced by the overset methodology are not too big.
  
* The '''first objective''' is to show how to set up an overset simulation with OpenFOAM. The overset methods (also know as chimera method) is very useful if large body motions have to be simulated. It consists in a fixed background mesh and one or more disconnected mesh regions which are subject to large displacements. In order to couple the disconnected mesh regions, the flow variables are interpolated between the meshes. Inside each disconnected mesh region, the solution is calculated by means of the usual finite volume discretisation.  The different mesh regions are usually not subject to topological changes which allows to maintain the original mesh quality.
+
In order to systematically explore the capabilities of the overset methodology, the degree of complexity is only slightly increased compared to the previous tutorial: In this tutorial the impact of a solid sphere on a liquid surface is simulated. With reference to the previous tutorial the Reynolds number is increased from 1.5 to approximately 5000. Even though the Re-number is increased quite a lot, the boundary layer still remains laminar (see [1] for experiments around a sphere). This means that no turbulence model has to be used. For this reason, the main difference to the previous tutorial is the impact of the solid sphere at a gas-liquid interface. Regarding this event, quite recently an interesting phenomena was observed experimentally (see [3]) and also simulated (see [2]): When a sphere with a hydrophobic coating impacts on a gas-liquid interface, a big air cavity is formed behind the sphere. In case of a hydrophilic coating, the liquid is able to enclose the sphere completely while impacting on the interface and no air cavity is formed behind the sphere. When the event is recorded by a microphone, a big splash is heard for the first case and only a blob for the second [3].  
 
 
* The '''second objective''' is to validate the overset methodology implemented into OpenFOAM with experiments. This is a mandatory step to estimate the uncertainty of a given simulation method. The uncertainty of a tool is connected to the risk not meeting a design criteria when this tool is employed in an industrial context.  
 
 
 
For this purpose the experimental setting by [1] was chosen to be simulated. The experimental settings consists in a rectangular box with dimensions of 100x100x160mm (in x-,y- and z-coordinate direction). Gravity points in negative z-direction. The lower part of the sphere was hanging 120mm from the bottom wall. The sphere had a diameter of 15mm and a density &rho;_s of 1120 kg/m^3. Different Re-numbers based on the free falling velocity  were measured (Re: 1.4, 4.1, 11.6 and 32.2). For this tutorial the lowest Re number was chosen. The variation of the Re-number in the experiments was achieved by choosing fluids with different fluid viscosities &mu;_f. The same can be done here if  other Re-numbers have to be simulated. The setup can be seen in the figure to the right.
 
  
 
==Simulation set up==
 
==Simulation set up==
Line 32: Line 28:
 
[[File:MergedMeshes_Alletto.png|300px|right|merged meshes]]
 
[[File:MergedMeshes_Alletto.png|300px|right|merged meshes]]
  
In this section the set up of the simulation is shown step by step and the choice of the parameters employed is tried to be justified whenever it is possible.  
+
In this section briefly the simulation set up is explained. Since most parts are very similar to the tutorial described [https://wiki.openfoam.com/Settling_Sphere_by_Michael_Alletto here], only the differences are highlighted. This are mainly the mesh and the used solver (overInterDyMFoam) with its required fields and boundary conditions.  
  
 
===Mesh generation===
 
===Mesh generation===
  
As in every CFD simulation the first step is to decide the domain extension and how to generate an adequate mesh which guarantees a desired solution quality. In this case the extension of the domain is obvious since the experimental setting is bounded by six walls. Figures to the right show the two meshes generated for the sphere (on the left) and for the background mesh (on the right). The figures show a slice through the mid plane of the mesh.
+
Although already explained in the tutorial [https://wiki.openfoam.com/Settling_Sphere_by_Michael_Alletto here] the steps to generate a mesh for the overset methodology in OpenFOAM is briefly explained. The steps are always the same and very simple: First the meshes around the moving bodies are generated. In our case it is only one around the sphere (first figure to the right). After that the background mesh is built (second figure to the right). The final step is the merging of the meshes around the moving bodies and the background mesh into one single mesh. The merged mesh is shown in the third figure to the right. Note that the mesh around the sphere has to be very fine in order to resolve the dynamics of the contact line between the liquid and the gas. In this case the height of the first cell was chosen to be 2.5e-5m.
 
 
The mesh around the sphere was generated with snappyHexMesh adding a few layers close to the wall. The fine resolution of the boundary layer is necessary to correctly predict the viscous and pressure forces which are later use to displace the sphere in the domain. The outer boundary should not be chosen to be too close to the sphere wall. The reason is to avoid that the errors generated by interpolating the solutions between the two meshes are affecting the boundary layer close to the sphere. However the outer boundary should not be chosen too far away in order to avoid the contact of the mesh around the sphere with the domain boundaries. Note that when generating the meshes which are displacing in the domain the outer boundaries have to be assigned to the type overset.  
 
  
The background mesh was generated with blockMesh and refining the mesh additionally with refineMesh in the domain centre where the mesh around the sphere is supposed to translate. The refinement is performed to reduce the interpolation errors between the background mesh and the mesh around the sphere. The interpolation errors are usually proportional to the cell size difference of the interpolation partners.
+
===Simulation set up===
 
 
After generating the two distinct meshes the meshes can be merged by mergeMesh. The result is shown in the figure to the right.
 
 
 
===Case set up===
 
  
 
[[File:ZoneID_Alletto.png|300px|right|zone id's]]
 
[[File:ZoneID_Alletto.png|300px|right|zone id's]]
 +
[[File:Alphawater_Alletto.png|300px|right|alpha water]]
  
Before starting the simulation one has to ensure the a field named zoneID has to be present in the 0 folder. Each cell zone should have a different zone id starting with 0. In our case there a two zones: one is the background mesh and the other is the mesh surrounding the sphere (see also Figure to the right). As mentioned before, it is also necessary for the overset method to work that the outer boundaries of the meshes which are moving in the domain are declared as type overset.  
+
In order that the interpolation between meshes works correctly, it is important that the outer boundary of each moving mesh has to be declared as type overset. Furthermore a scalar field named zoneID has to be created. Each region in the domain has to have its own id. In our case there are only two regions: the moving mesh around the sphere with id 1 and the background mesh with id 0 (see figure on the right side). The order of the numbers does not matter. The important thing is that they start with 0. On the right hand side in the figure the initialization of the indicator field alpha (1 for water 0 for air) is shown. Both fields can be initialized with the setFields utility.  
  
Another field which is necessary for the mesh around the sphere to move is the one called pointDisplacement. For this field the sphere walls should be declared as type calculated. The reason is that the displacement of the sphere walls will be calculated by the motion solver.  
+
In order to match the experiments by [3] and the simulations by  [2] the velocity of the sphere is initialized with 5 m/s. The motion of the sphere is calculated with the sixDoFRigidBodyMotion solver. For a velocity of 5 m/s and a water-air interface, [3] and [2] reported a completely different behaviour of the air cavity behind the sphere impacting the interface: For a hydrophobic coatings a big air cavity is formed while for hydrophilic coating almost no cavity is formed. To simulate this two different scenarios, two simulations with different static contact angles &theta;<sub>0</sub> are performed: &theta;<sub>0</sub> = 30° and &theta;<sub>0</sub> = 150°. The lower contact angle is the hydrophobic case and the higher contact angle the hydrophilic case. Here the same definition as used in OpenFOAM is taken: The contact angle is defined inside the liquid going from the solid surface towards the liquid-gas interface. The application of a static contact angle seems to be a very crude assumption. The reason is that close to a moving contact line different physical effects play a role depending on the distance to triple contact point between the solid, the liquid and the gas (see the review of [4]). Since the scope of the tutorial is to show the qualitative difference between a hydrophobic and a hydrophilic coating, the crude assumption is appropriate.
  
The way to tell OpenFOAM that the mesh is changing is to have a file called dynamicMeshDict in the constant folder. There the settings for the motion solver have to made. The dynamicMeshDict is shown below. The displacement of the sphere (the patch named sphere) is calculated by the sixDoFRigidBodyMotion solver. It integrates the viscose and pressure forces over the patch to get the forces acting on the sphere. The displacement is than calculated by applying Newton's second law. Note that the mass has to be reduced by the Buoyancy since the overPimpleDyMFoam solver does not consider the hydrostatic pressure. In order to get a good agreement of the temporal evolution of the displacement and velocity of the sphere this is necessary.
+
===Simulation results===
 
 
<TT>
 
motionSolverLibs ( "libsixDoFRigidBodyMotion.so" );
 
 
 
dynamicFvMesh      dynamicOversetFvMesh;
 
 
 
dynamicOversetFvMeshCoeffs
 
 
 
{
 
//    layerRelax 0.3;
 
}
 
 
 
solver          sixDoFRigidBodyMotion;
 
 
 
accelerationRelaxation 0.4;
 
 
 
sixDoFRigidBodyMotionCoeffs
 
 
 
{
 
 
 
patches        (sphere);
 
 
 
innerDistance  100.;
 
 
 
outerDistance  101.;
 
       
 
accelerationRelaxation 0.4;
 
 
 
accelerationDamping 0.4;
 
   
 
//  mass reduced by Buoyancy: (rhosolid - rhofluid ) * VolumeSphere
 
 
 
mass            2.65E-04;
 
 
 
centreOfMass    ( 0 0 0 );   
 
 
 
momentOfInertia ( 4.45E-08 4.45E-08 4.45E-08);
 
 
 
rho            rhoInf;
 
 
 
rhoInf          970;
 
 
 
g              (0 0 -9.81);
 
  
report          on;
+
Figures in the bottom show four snapshots for different times after the release of the sphere. The left column represents the hydrophilic case and the right column the hydrophobic case. It is evident that the air cavity shows a completely different behaviour for the two cases analyzed. For the hydrophilic case almost no air cavity is observed after the entrance of the sphere into the water. For the hydrophobic case a big cavity is formed. This observations are in qualitative agreement with the [3] and the simulations by [2].
  
reportToFile    on;
+
What has to be mentioned, is that for both cases after some distance from the water-air interface the mesh around the sphere starts to turn and the trajectory of the sphere deviates from a straight line. The reasons are still unknown. An educated guess is that an asymmetry of the interpolation errors introduced by the overset methodology leads to this asymmetric behaviour of the sphere trajectory.
   
 
solver{ type Newmark;}
 
   
 
constraints{}
 
  
}
+
The last figure shows the evolution of the normalized water volume with time. The normalization value is the water volume specified at the simulation start. It is evident that the water volume is increasing. This may have multiple reason. The first reason may be that the resolution at the interface between the water and the air is too coarse. The discretization error of the indicator function alpha may lead to a non--constant volume of the water fraction over time. Note that the laminar dam break tutorial (tutorials/multiphase/interFoam/laminar/damBreak/damBreak) shows also a non--constant evolution of the water volume over time. Another source of error comes from the overset interpolation. Since the applied inverse distance interpolation is not mass conservative this can lead also to a non--constant water volume over time.  
 
 
// ************************************************************************* //
 
</TT>
 
 
 
After having made this settings, everything is ready to start with the simulation. Note that the maximum Courant number is changed during the simulation (it is done automatically by the timeActivatedFileUpdate function object). This is done in order to reduce the simulation time. In the beginning  of the simulation a small maximum Courant number is required in order to keep the simulation stable. The reason is probably that the sudden movement of the sphere generates pressure oscillations which lead also to oscillations in the sphere displacement. This mutual coupling can destabilize the simulation.
 
 
 
===Simulation results===
 
  
Finally the comparison with the experiments is shown in the figures below.
+
[[File:Alltimesteps_SphereSplash_Alletto.png|600px|center|cavities behind the two spheres]]
  
It is evident that good agreement could be achieved with the reference experiment until the mesh surrounding the sphere overpasses the bottom wall. Unfortunately than the simulation crashed. However the good agreement between the simulation and the experiments (at least for this case) helps to get confidence regarding the reliability of the overset method implemented in OpenFOAM.  
+
[[File:Alpha_SphereSplash_Alletto.png|600px|center|Evolution of the ratio of water volume to the initial water volume.]]
  
[[File:Displacement_Allettoo.png|600px|bottom|Comparison with the experiments - displacement]]
+
==References==
[[File:Velocity_Alletto.png|600px|bottom|Comparison with the experiments - velocity]]
 
  
 
[1] Elmar Achenbach. Experiments on the flow past spheres at very high reynolds numbers. Journal of Fluid Mechanics, 54(3):565-575, 1972.
 
[1] Elmar Achenbach. Experiments on the flow past spheres at very high reynolds numbers. Journal of Fluid Mechanics, 54(3):565-575, 1972.

Latest revision as of 05:46, 1 February 2024

Go back to Collection by authors.

Go back to Meshing.

Sphere settling under the influence of gravity with varying contact angle

You can download the case file [1] here.

Introduction

In this tutorial the capabilities of the overset methodology of OpenFOAM are further explored. In the previous tutorial a sphere settling under the influence of gravity was simulated (see this tutorial for more information.

It was shown, that the temporal evolution of the displacement and the velocity of a sphere settling in a viscous fluid is well captured. This means that the viscous and pressure forces integrated over the sphere surface are well captured. Furthermore it also means that the interpolation errors introduced by the overset methodology are not too big.

In order to systematically explore the capabilities of the overset methodology, the degree of complexity is only slightly increased compared to the previous tutorial: In this tutorial the impact of a solid sphere on a liquid surface is simulated. With reference to the previous tutorial the Reynolds number is increased from 1.5 to approximately 5000. Even though the Re-number is increased quite a lot, the boundary layer still remains laminar (see [1] for experiments around a sphere). This means that no turbulence model has to be used. For this reason, the main difference to the previous tutorial is the impact of the solid sphere at a gas-liquid interface. Regarding this event, quite recently an interesting phenomena was observed experimentally (see [3]) and also simulated (see [2]): When a sphere with a hydrophobic coating impacts on a gas-liquid interface, a big air cavity is formed behind the sphere. In case of a hydrophilic coating, the liquid is able to enclose the sphere completely while impacting on the interface and no air cavity is formed behind the sphere. When the event is recorded by a microphone, a big splash is heard for the first case and only a blob for the second [3].

Simulation set up

sphere mesh
background mesh
merged meshes

In this section briefly the simulation set up is explained. Since most parts are very similar to the tutorial described here, only the differences are highlighted. This are mainly the mesh and the used solver (overInterDyMFoam) with its required fields and boundary conditions.

Mesh generation

Although already explained in the tutorial here the steps to generate a mesh for the overset methodology in OpenFOAM is briefly explained. The steps are always the same and very simple: First the meshes around the moving bodies are generated. In our case it is only one around the sphere (first figure to the right). After that the background mesh is built (second figure to the right). The final step is the merging of the meshes around the moving bodies and the background mesh into one single mesh. The merged mesh is shown in the third figure to the right. Note that the mesh around the sphere has to be very fine in order to resolve the dynamics of the contact line between the liquid and the gas. In this case the height of the first cell was chosen to be 2.5e-5m.

Simulation set up

zone id's
alpha water

In order that the interpolation between meshes works correctly, it is important that the outer boundary of each moving mesh has to be declared as type overset. Furthermore a scalar field named zoneID has to be created. Each region in the domain has to have its own id. In our case there are only two regions: the moving mesh around the sphere with id 1 and the background mesh with id 0 (see figure on the right side). The order of the numbers does not matter. The important thing is that they start with 0. On the right hand side in the figure the initialization of the indicator field alpha (1 for water 0 for air) is shown. Both fields can be initialized with the setFields utility.

In order to match the experiments by [3] and the simulations by [2] the velocity of the sphere is initialized with 5 m/s. The motion of the sphere is calculated with the sixDoFRigidBodyMotion solver. For a velocity of 5 m/s and a water-air interface, [3] and [2] reported a completely different behaviour of the air cavity behind the sphere impacting the interface: For a hydrophobic coatings a big air cavity is formed while for hydrophilic coating almost no cavity is formed. To simulate this two different scenarios, two simulations with different static contact angles θ0 are performed: θ0 = 30° and θ0 = 150°. The lower contact angle is the hydrophobic case and the higher contact angle the hydrophilic case. Here the same definition as used in OpenFOAM is taken: The contact angle is defined inside the liquid going from the solid surface towards the liquid-gas interface. The application of a static contact angle seems to be a very crude assumption. The reason is that close to a moving contact line different physical effects play a role depending on the distance to triple contact point between the solid, the liquid and the gas (see the review of [4]). Since the scope of the tutorial is to show the qualitative difference between a hydrophobic and a hydrophilic coating, the crude assumption is appropriate.

Simulation results

Figures in the bottom show four snapshots for different times after the release of the sphere. The left column represents the hydrophilic case and the right column the hydrophobic case. It is evident that the air cavity shows a completely different behaviour for the two cases analyzed. For the hydrophilic case almost no air cavity is observed after the entrance of the sphere into the water. For the hydrophobic case a big cavity is formed. This observations are in qualitative agreement with the [3] and the simulations by [2].

What has to be mentioned, is that for both cases after some distance from the water-air interface the mesh around the sphere starts to turn and the trajectory of the sphere deviates from a straight line. The reasons are still unknown. An educated guess is that an asymmetry of the interpolation errors introduced by the overset methodology leads to this asymmetric behaviour of the sphere trajectory.

The last figure shows the evolution of the normalized water volume with time. The normalization value is the water volume specified at the simulation start. It is evident that the water volume is increasing. This may have multiple reason. The first reason may be that the resolution at the interface between the water and the air is too coarse. The discretization error of the indicator function alpha may lead to a non--constant volume of the water fraction over time. Note that the laminar dam break tutorial (tutorials/multiphase/interFoam/laminar/damBreak/damBreak) shows also a non--constant evolution of the water volume over time. Another source of error comes from the overset interpolation. Since the applied inverse distance interpolation is not mass conservative this can lead also to a non--constant water volume over time.

cavities behind the two spheres
Evolution of the ratio of water volume to the initial water volume.

References

[1] Elmar Achenbach. Experiments on the flow past spheres at very high reynolds numbers. Journal of Fluid Mechanics, 54(3):565-575, 1972.

[2] Minh Do-Quang and Gustav Amberg. The splash of a solid sphere impacting on a liquid surface: numerical simulation of the influence of wetting. Physics of Fluids, 21(2):022102, 2009.

[3] Cyril Duez, Christophe Ybert, Christophe Clanet, and Lyderic Bocquet. Making a splash with water repellency. Nature physics, 3(3):180, 2007.

[4] Jacco H Snoeijer and Bruno Andreotti. Moving contact lines: scales, regimes, and dynamical transitions. Annual review of fluid mechanics, 45:269-292, 2013.