
[Sponsors] 
November 19, 2009, 13:13 
new curvature model with interFoam

#1  
New Member
Chris
Join Date: Oct 2009
Posts: 5
Rep Power: 10 
Hi,
I want to test a new curvature model by using InterFoam. When I try to compile the following code I get an error, but I don't know how to fix it. I hope, someone can help me. Code:
//Cell gradient of gamma volVectorField gradGamma = fvc::grad(gamma); // Interpolated facegradient of gamma surfaceScalarField phiGradGamma = fvc::interpolate(gradGamma)& mesh.Sf(); //curvature surfaceScalarField kappa = ((1) / mag(gradGamma)) * (((gradGamma)/(mag(gradGamma))) * fvc::grad(mag(gradGamma)) //line.29=>  fvc::div(phiGradGamma)); Quote:


November 20, 2009, 11:01 

#2 
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 10 
Dear Chris,
the error you get tells you your problem quite clearly. You just need to check carefully. You want to calculate a surfaceScalarField for the curvature. Obviosly there is a volTensorField somewhere inside your calculation. Because it is not possible to initialize a surfaceScalarField by a volTensorField you get an error. Go carefully through your expression and you will find //curvature surfaceScalarField kappa = ((1) / mag(gradGamma)) * (((gradGamma)/(mag(gradGamma))) * fvc::grad(mag(gradGamma)) //line.29=>  fvc::div(phiGradGamma));(1)/mag(gradGamma) gives you a volScalarField (remember you want to have a surfaceScalarField, at least you seam to initialize it that way) you multiply it by the volVectorField (gradGamma)/mag(gradGamma) now you have a volVectorField now you perform another multiplication and I'm not sure what you inted to do. you multiply it by another volVectorField. The * operator gives you the outer product of two vectors and produces a tensor. Now we have your volTensorField. In addition you now want to subtract the divergence of a scalar? What is that? In summary: 1. you are not allowed to mix fields defined on the faces and on the volumes. 2. you should go over your mathematics, I think theres a bug inside your implementation or inside the equation you are trying to implement. If you need help on that, we would need the equation Hope this helps Best Kathrin 

November 21, 2009, 11:42 

#3 
New Member
Chris
Join Date: Oct 2009
Posts: 5
Rep Power: 10 
Dear Kathrin,
thank you for the hints. I think my implementation is blemished. I'll go through my implementation and try to correct it. If this doesn't work, I would post the equation. Best Chris 

December 2, 2009, 07:26 

#4  
New Member
Chris
Join Date: Oct 2009
Posts: 5
Rep Power: 10 
Hi,
I did it and compiled the solver, but a new problem appears. Here is the equation: Code:
volVectorField gradGamma = fvc::grad(gamma); volScalarField kappa = ((1) / mag(gradGamma)) *((((gradGamma)/(mag(gradGamma))) & fvc::grad(mag(gradGamma)))  (fvc::div(gradGamma) )); Quote:
Quote:


December 2, 2009, 07:47 

#5 
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 10 
Hi Chris,
what you yre trying to do is applying a laplacian. So you should do something like fvc::laplacian(gamma) instead of fvc::div(gradGamma) be very carefull with the mathematics! of course, then you need to specify a laplacian scheme. You can also go fvc::laplacian(gamma, nameOfYourDesiredScheme) then the scheme is hardcoded and cannot be changed from fvSchemes. Check on src/finiteVolume/finiteVolume/fvc/fvcLaplacian.H/.C for details. Hope this helps Kathrin 

December 2, 2009, 08:41 

#6  
New Member
Chris
Join Date: Oct 2009
Posts: 5
Rep Power: 10 
Hi kathrin,
I tried fvc::laplacian(gamma) with Gauss linear corrected, running the case and I get a floating point exception. Quote:


December 2, 2009, 09:57 

#7 
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 10 
Could you do me a favour?
Get rid of the laplacian term for a second, and check whether the problem really is in that one. If this is not the point. Maybe your dividing by zero somewhere. Try 1/(mag(gradGamma)+SMALL) where SMALL is a small number rescueing you from dividing by zero, which will definitly give you a floating point exeption. Best Kathrin 

December 2, 2009, 13:37 

#8 
New Member
Chris
Join Date: Oct 2009
Posts: 5
Rep Power: 10 
Hi Kathrin,
I tried +SMALL, but it seems there are more divisions by zero. I think this division makes problems: gradGamma/mag(gradGamma) When I look into interfaceProperties, I find this: surfaceVectorField nHatfv = gradGammaf/(mag(gradGammaf) + deltaN_) I'm not sure, but I think that this missing deltaN_ causes the floating point exceptions. deltaN_ ( "deltaN" 1e8/pow(average(gamma.mesh().V()), 1.0/3.0) ) Edit: I fixed the floating point exception. The problem was a couple of division by zero. Thank you very much Kathrin for the hint. But now, there is a dimension problem. Best Chris Last edited by DaChris; December 2, 2009 at 18:02. 

October 22, 2010, 08:45 

#9 
Member

Hi Chris,
I am doing Taylor bubble simulation with OF. I also have some problems with curvature since it is very important in my flow. Do you get a better result with your model of calculating curvature? Can you share some of your tests? Regards, Duong 

March 2, 2011, 10:18 

#10 
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 313
Rep Power: 9 
Hi,
I also try to define the curvature of the interface for my simulation using interFoam. Has anyone found a good way to get it?? because with the classical definition in interfaceProperties.C i get strange results. Thanks andrea 

May 31, 2013, 09:53 

#11 
Member
Join Date: Aug 2011
Posts: 83
Rep Power: 8 
Hi,
I am a little confused of how the interface in a cell is modeled in the interFoamsolver. I´ve got difficulties to imagine one step. If I am right, the following steps are repeated:  alpha1 is calculated  interface unit normal vector is calculated (PhD Rusche eq(4.17))  the curvature is calculated with this normal vector. I can´t really understand how I get the interface from the curvature. Can somebody help me please? Thanks a lot Idefix 

July 10, 2014, 10:24 

#12 
Member
Vignesh
Join Date: Oct 2012
Location: Darmstadt, Germany
Posts: 63
Rep Power: 6 
Hi all !!
I am also trying to model the surface tension force with a new formulation : I have modified some of the lines (in bold letters) in PEqn.H file in interfoam solver directory to model the force. Code:
volScalarField lapalpha(fvc::laplacian(alpha1)); surfaceScalarField phig ( ( fvc::interpolate(lapalpha)*interface.sigma()*interface.nHatf()  ghf*fvc::snGrad(rho) )*rAUf*mesh.magSf() ); Also, I want to know whether i have coded correctly ? I am new to Openfoam !! Thanks and Regards Vignesh TG 

February 6, 2015, 05:36 

#13 
New Member
Martin K
Join Date: Jan 2013
Location: Germany
Posts: 28
Rep Power: 6 
Hi Vignesh,
curvature calculation seems to be crucial in interfoam/CSF, did you make any progress with this approach? best regards Martin 

February 6, 2015, 06:04 

#14 
Member
Vignesh
Join Date: Oct 2012
Location: Darmstadt, Germany
Posts: 63
Rep Power: 6 
Hi Martin,
I implemented the above formulation but it doesn't work properly. I suggest you to give a try to the code interfoamssf posted in this thread !! There is also a paper by the same person regarding its formulation. also this thread how is parasitic currents now ?
__________________
Thanks and Regards Vignesh 

February 6, 2015, 08:19 

#15 
New Member
Martin K
Join Date: Jan 2013
Location: Germany
Posts: 28
Rep Power: 6 
Thanks a lot for your answer, I will have a look!


July 31, 2017, 07:57 

#16 
Member
Niu
Join Date: Apr 2014
Posts: 48
Rep Power: 5 
Dear Martin,
Have you got any new idea about the curvature model for interFoam ? 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Problems bout CFD model of biomass gasification, Downdraft gasifier  wanglong  FLUENT  2  November 26, 2009 00:27 
help for different between les model (subgridscale model)  liuyuxuan  FLUENT  1  October 2, 2009 15:25 
Grid resolution for fullscale and down scaled model  gravis  Main CFD Forum  0  October 2, 2009 10:27 
references about the fan/radiator model  Mihai ARGHIR  FLUENT  0  December 17, 2000 07:40 
Advanced Turbulence Modeling in Fluent, Realizable kepsilon Model  Jonas Larsson  FLUENT  5  March 13, 2000 04:27 