Help!! customize surface tension term in interFoam
Hi guys, I am trying to replace the original surface tension term in interFoam using a custom code.
The original surface tension term mathematically can be expressed as Kappa*sigma*grad(alpha1). And interFoam expresses this term as fvc::interpolate(interface.sigmaK())*fvc::snGrad(a lpha1) Based on my understanding, what interFoam does is to calculate the surface tension on face center as a scalar and then reconstruct to the cell center as a vector. Therefore, "fvc::interpolate(interface.sigmaK())*fvc::snGrad( alpha1)" is a scalar rather than a vector. What I am trying to do is to replace the above mentioned term by another function aiming to calculate the force between any cell to the rest of the cells in the domain. Here is my code. It complies and runs OK, but no matter how long I run the code, the results of test case does not make sense. BTW, my test case is to place a air rectangle in a liquid box and see if the rectangle can become a circle eventually. Test case does not make sense means that the air rectangle does not change its shape. Code:
volVectorField newSurfaceTension //create volume vector field After that I will update surface tension term in UEqn.H and pEqn.H. Using UEqn.H as an example. Code:
fvVectorMatrix UEqn |
My guess is you calculate the new surface tension in createFields.H - it is never updated.
|
Quote:
Thanks for your reply, Anton. I will try to implement the new surface tension to interFoam.C rather than createFields.H then. I will keep you updated. |
Just to add more to this, the nested for loops on the order of n^2 may be slower than if you iterated over cell faces (instead of cell centers) and looked at owner and neighbour cells of that face. Look in the
$FOAM_SRC/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/LimitedScheme/LimitedScheme.C |
Hi Anton,
I tried to insert my piece of code (let's call it SURFACE_TENSION and can be found in my original post) to multiple places of interFoam.C (one at a time), however, the results are still like you said before, it was never updated.... The relevant code are below. Could anyone give me more advice? Code:
while (runTime.run()) |
Quote:
|
All times are GMT -4. The time now is 12:52. |