CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Initializing freesurface in 3D geometry (https://www.cfd-online.com/Forums/openfoam-solving/58628-initializing-freesurface-3d-geometry.html)

jaswi June 4, 2007 06:42

Dear OpenFOAM users I am lo
 
Dear OpenFOAM users

I am looking for help on specifying free-surface interface for a 3d geometry. The problem setup is following:

I have a shake-flask geometry. I am using interFoam to simulate the mixing of two fluids. Right now I am stuck with how to specify the height of the free surface. In CFX it could be done easily using the step function (ref. tutorial 7 of CFX). I am attaching the figure for clarity.

http://www.cfd-online.com/OpenFOAM_D...ges/1/4602.jpg

Please help me !!!!
Thanks in advance

With Kind regards
Jaswi

liu June 4, 2007 11:08

setField?
 
setField?

jaswi June 4, 2007 11:17

Thanks Liu. I have looked i
 
Thanks Liu.

I have looked into the dambreak problem and trying with the box option. What i am not sure is that whether one could use the box command to specify a 3d region. box requires min and max. right now my approach is trial and error :-). If you please know how box works then please help

Kind Regards
Jaswi

joakim June 4, 2007 11:54

In setField you specify the co
 
In setField you specify the coordinates of the boxdiagonal. For example, if you specify the coordinates of a unitbox centered at origo you would do

(-0.5,-0.5,-0.5) (0.5,0.5,0.5)

If your box can enclose the region of interest than this should be straight forward.

Good luck

/Joakim

jaswi June 5, 2007 05:30

Thanks a lot Joakim. It works
 
Thanks a lot Joakim. It works !!!!. Just one last doubt :-)...
The domain is cylindrical and the box command is rectangular. I am specifying a box with the size a little larger than my cylinder. Does setField works on the set :

(cylinder) Intersection (box)
----
Also i have seen some people using funkySetField. Did u ever come across it !!!. With box command the interface is not very sharp and i am just wondering if funkySetField will give sharper interface. I am just a bit short of time to give it a try for now :-)


Thanks once again. U saved my life :-D

With Kind Regards
Jaswi

joakim June 5, 2007 05:44

Hi Jaswi Yes it works fine.
 
Hi Jaswi

Yes it works fine.
I have never tried the funkySetField.

Hope things works for you.

Regards

/Joakim

gschaider June 5, 2007 07:20

Hi Jaswi! @funkySetFields:
 
Hi Jaswi!

@funkySetFields: I don't know what you mean with sharp. With

funkySetField . yourCase -field gamma -condition "pos().z<0" -expression "1."

you would get a partially filled geometry. The "problem" (and I think the same is true for setFields with the box option) is that the condition is only evaluated for the centers of the cells. So if the cell layer around z==0 is not "parallel" to the xy-plane you might get a "ragged" interface (no partially filled cells). So actually it produces a "sharper" interface than is desirable for that case

jaswi June 5, 2007 08:50

Thanks a lot Bernhard shall
 
Thanks a lot Bernhard

shall give it a try :-)

Regards
Jaswi

PS: Bernhard I am posting a further query. Please take a look at your convenience.

fw407 August 20, 2008 12:10

Hi, I download "funkSetfiel
 
Hi,

I download "funkSetfields" from the wiki page, when I try to compile it, I run into erros:

//***************
./ValueExpressionDriver.H:22: error: incomplete type 've::ValueExpressionParser' used in nested name specifier
./ValueExpressionDriver.H:22: error: 'yylval' was not declared in this scope
./ValueExpressionDriver.H:22: error: expected primary-expression before '*' token
./ValueExpressionDriver.H:22: error: 'yylloc' was not declared in this scope
./ValueExpressionDriver.H:22: error: expected primary-expression before '&' token
./ValueExpressionDriver.H:22: error: 'driver' was not declared in this scope
./ValueExpressionDriver.H:22: error: initializer expression list treated as compound expression
ValueExpressionParser.tab.cc: In member function 'virtual int yy::ValueExpressionParser::parse()':
ValueExpressionParser.tab.cc:409: error: 'velex' cannot be used as a function
In file included from ValueExpressionParser.yy:63,
from ./ValueExpressionDriver.H:11,
from ValueExpressionLexer.ll:3:
./ValueExpressionDriverLogicalTemplates.H:7: error: expected initializer before '<' token
./ValueExpressionDriverLogicalTemplates.H:13: error: expected initializer before '<' token
./ValueExpressionDriverLogicalTemplates.H:48: error: invalid use of incomplete type 'struct ValueExpressionDriver'
ValueExpressionParser.yy:27: error: forward declaration of 'struct ValueExpressionDriver'
./ValueExpressionDriverLogicalTemplates.H:74: error: invalid use of incomplete type 'struct ValueExpressionDriver'
ValueExpressionParser.yy:27: error: forward declaration of 'struct ValueExpressionDriver'
./ValueExpressionDriverLogicalTemplates.H:105: error: invalid use of incomplete type 'struct ValueExpressionDriver'
ValueExpressionParser.yy:27: error: forward declaration of 'struct ValueExpressionDriver'
./ValueExpressionDriverLogicalTemplates.H:133: error: invalid use of incomplete type 'struct ValueExpressionDriver'
ValueExpressionParser.yy:27: error: forward declaration of 'struct ValueExpressionDriver'
In file included from ValueExpressionLexer.ll:3:
./ValueExpressionDriver.H:22: error: incomplete type 've::ValueExpressionParser' used in nested name specifier
./ValueExpressionDriver.H:22: error: 'yylval' was not declared in this scope
./ValueExpressionDriver.H:22: error: expected primary-expression before '*' token
./ValueExpressionDriver.H:22: error: 'yylloc' was not declared in this scope
./ValueExpressionDriver.H:22: error: expected primary-expression before '&' token
./ValueExpressionDriver.H:22: error: 'driver' was not declared in this scope
./ValueExpressionDriver.H:22: error: initializer expression list treated as compound expression
lex.ve.c:6945: error: redefinition of 'int velex'
./ValueExpressionDriver.H:22: error: 'int velex' previously defined here
lex.ve.c:6945: error: incomplete type 've::ValueExpressionParser' used in nested name specifier
lex.ve.c:6945: error: 'yylval' was not declared in this scope
lex.ve.c:6945: error: expected primary-expression before '*' token
lex.ve.c:6945: error: 'yylloc' was not declared in this scope
lex.ve.c:6945: error: expected primary-expression before '&' token
lex.ve.c:6945: error: 'driver' was not declared in this scope
ValueExpressionParser.tab.cc: In member function 'unsigned char yy::ValueExpressionParser::yytranslate_(int)':
ValueExpressionParser.tab.cc:2141: warning: use of old-style cast
ValueExpressionParser.yy: At global scope:
ValueExpressionParser.yy:327: error: expected unqualified-id before '&' token
ValueExpressionParser.yy:327: error: expected ',' or '...' before '&' token
ValueExpressionParser.yy:327: error: invalid use of incomplete type 'struct ve::ValueExpressionParser'
//************************

Could anyone give me some ideas?

BTW:I read the "README" file, it says it works for OF 1.4, but I am now using 1.4.1-dev

Kind regards

feng

fw407 August 20, 2008 13:27

Hi, I get some idea from th
 
Hi,

I get some idea from the following link, and the problem is solved.....

http://www.cfd-online.com/OpenFOAM_D...ges/1/368.html

kind regards

feng


All times are GMT -4. The time now is 23:38.