new curvature model with interFoam
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 Quote:
|
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 |
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 |
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 |
Hi kathrin,
I tried fvc::laplacian(gamma) with Gauss linear corrected, running the case and I get a floating point exception. Quote:
|
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 |
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" 1e-8/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 |
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 |
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 |
Hi,
I am a little confused of how the interface in a cell is modeled in the interFoam-solver. 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 |
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)); Also, I want to know whether i have coded correctly ? I am new to Openfoam !! Thanks and Regards Vignesh TG |
Hi Vignesh,
curvature calculation seems to be crucial in interfoam/CSF, did you make any progress with this approach? best regards Martin |
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 a lot for your answer, I will have a look!
|
Dear Martin,
Have you got any new idea about the curvature model for interFoam ? |
All times are GMT -4. The time now is 04:23. |