Sorry to bother again.
But the solution with the bessel function did not turn out to be working. Actually the new function in funkySetFields is working, but the result is not as planned. The function named in the paper mentioned above turns out to produce a different interface than I desired. At this point I need an advice, which function the correct interface is representing. Please refer to the two attached images from a previous post. I want to set up this cosine-function in 3D on a square domain, meaning that the interface should be elevated at the walls and be lowered in the center of the domain forming this cosine-like 'tub'. I'm not quite shure which function (in 3D) would represent such an interface, nor where to look at (or start investigating). Please don't smack me for posting in the funkySetFields thread, as this this not directly linked to the tool but is rather basic. But as this should lead to a condition statement for funkySetFields I thought it would be good place to ask for. Many thanks for your ideas. S. |
Quote:
|
Hi,
I am just trying to figure out, how this expression '(grad(dist())^vector(0,0,-1))*mag(pos()-vector(0.05,0.05,0))/0.05' creates a fild in a circle. I got trouble to understand it... I would like to achieve something like: u=2*y*(1-x^2), v=-2*x*(1-y^2) It is probably similar!? Thanks! Fabian |
Quote:
General circular field around a point in the xy-plane might be '(pos()-vector(1,2,0))^vector(0,0,1)' Bernhard |
Hi Bernhard,
thanks for the explanation! Regards! Fabian |
fpos() and surf() synthax error
Hy funkyFOAMers,
I've generated an initial Field for an interFoam simulation by using funkySetFileds and it worked quite well. Now I'm trying to smoothen the free surface by using the commands shown on this page: http://openfoamwiki.net/index.php/Co...funkySetFields But I can't get it working. I always receive the following error: Parser Error at "1.9-12" :"syntax error, unexpected TOKEN_fposition" "average(fpos().z <= surf(0.) ? surf(1.0) : surf(0.))" " ^^^^ " Being in the case directory the executed command is the following: funkySetFields -case ./ -time 0 -field alpha1 -keepPatches -expression "average (fpos().z <= surf(0.) ? surf(1.0) : surf(0.))" Has anybody an idea, how to modify the command in order to do what desired? Thanks in advance, Toni |
1 Attachment(s)
this is my initial filed:Attachment 7554
|
Quote:
Maybe the problem is that in newer versions of FSF what used to be called average was renamed to faceAverage (averaging over the faces of a cell. average is now the average of a whole field) Bernhard |
It seems that I didn't read the thread carefully - sorry for the inconvenience...
With the following link I switch now to a newer one, that implies a newer version of FSF. http://www.cfd-online.com/Forums/ope...eld-patch.html |
Quote:
I use the above expression to initial alpha.water in OF 2.3.0. error occurs such as : Modifying field alpha.water of type volScalarField Putting "average(fpos().z < surf(0.) ? surf(1.0) : surf(0.))" into field alpha.water at t = "0" if condition "true" is true Keeping patches unaltered --> FOAM FATAL ERROR: inconsistent types: alpha.water is volScalarField while the expression evaluates to a surfaceScalarField From function doAnExpression() in file funkySetFields.C at line 361. FOAM exiting |
Quote:
|
Quote:
that is the reason. it works now. |
All times are GMT -4. The time now is 12:59. |