CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] FunkySetFields dictionary (https://www.cfd-online.com/Forums/openfoam-community-contributions/58255-funkysetfields-dictionary.html)

gschaider November 19, 2008 07:36

FunkySetFields dictionary
 
Hi Sara!

What exactly is the problem?
Does funkySetField stop with an error message? Or does ist simply not change your field? In the second case try a bigger radius. Maybe no cells (pos() uses the cell-center) were "caught" by your condition (one hint could be the output "condition ... true in 0 cells" or something like this)

Bernhard

sara November 19, 2008 20:19

Oh sorry. FunkySetFields star
 
Oh sorry.
FunkySetFields starts to get executed - that is the openfoam header appears. Then I get:

funkySetFields: time/latestTime option is required

From function main()
in file funkySetFields.C at line 210.

FOAM exiting

So it doesn't start to set any cells at all. Just complains abouth the missing time. But I wrote the time in the directory at every place I could think of and it gave me the same error message.
Any ideas?

gschaider November 20, 2008 04:30

Well. I think the error messag
 
Well. I think the error message says it all: start FSF with -help. You will see that there is a -time and a -latestTime option. One of them has got to be specified (as you're doing ICs propably "-time 0").

The reason behind that is that I wanted the user to defintly tell the tool which time-step to manipulate (so that nobody can complain afterwards if FSF messed up a valuable/valid solution)

Bernhard

hamsadhwani8 November 20, 2008 14:37

Is there an installation guide
 
Is there an installation guide for funkySetFields?

I want to install it on mac os x 10.5. I am using openfoam 1.5

Thanks,
ss

sara November 20, 2008 19:06

Yeah, sorry, I got it. I didn'
 
Yeah, sorry, I got it. I didn't realize that I have to add the time in the command line, I thought I could add it in the dictionary. It works fine now.
However I have another question, maybe you have some ideas about it:
I want to insert many little droplets (that is: spheres) at my inlet. Of course I could just write them one after another in the dictionary, but since I'm thinking of a number around 400, this doesn't seem like a good idea.
Can you give me some advice what to do instead? I thought about a random distribution, but I don't know how to integrate this in the "condition"-expression.
Cheers, Sara

gschaider November 21, 2008 09:46

Hi Sara! I'm afraid stuff l
 
Hi Sara!

I'm afraid stuff like loops won't work with funkySetFields (and who was there in the back shouting "And if there was a scripting facility in FSF, Bernhard would have used that children's language (what's it called? Cobra, Mamba or so) not proper C++". Show yourself).

If your points are regulary spaced something using a modulo operator (%) could work, but I'm not quite sure whether that operator is implemented in FSF. Will check

Bernhard

sara November 23, 2008 19:14

Hi Bernhard Thanks for your a
 
Hi Bernhard
Thanks for your answer. That would be great if you could find out about the modulo operator.
If the points are regularly spaced that's alright.
Thanks for helping me, Sara

gschaider November 24, 2008 04:23

Hi Sara! I checked. There c
 
Hi Sara!

I checked. There currently is no modulo-operator in FSF

Bernhard

gschaider December 1, 2008 17:00

Hi Sara! Now there is (a mo
 
Hi Sara!

Now there is (a modulo operator). Please see the Wiki page and get the recent version from the SVN

Bernhard

sara December 2, 2008 01:13

Hi Bernhard Many thanks! Sor
 
Hi Bernhard
Many thanks!
Sorry for bothering you with this, but after some thinking I still don't get it how the modulo operator will be of any use to my problem if loops don't work.
My expression which sets the location of the droplet in FunkySetFields looks like this:

condition "mag( pos() - vector(0,0,0))<1e-03":

Now I want to keep x = 0 and y and z to increase up to 0.1.
I've done this "by hand" so far. I just repeated the whole expression a 100 times.
But I can't see how I can achieve the same using modulo. Could you please give me a hint?
Cheers, Sara

gschaider December 2, 2008 05:06

Hi Sara! For instance to bu
 
Hi Sara!

For instance to build a "grid" of droplets with a spacing (4,5,0) and a radius 1 you could use a condition like this:

"mag(vector(pos().x % 4,pos().y % 5,0))<1"

(I hope you get the idea. Test the subexpression "pos().x % 4" to understand how it works)

Bernhard

sara December 2, 2008 21:56

Hi Bernhard Thanks for your a
 
Hi Bernhard
Thanks for your answer.
I got the most recent version of funkySetFields and tried this, but when using the modulo operator (%) I get: Parser Error "invalid character".
I tried exactly the condition you wrote above. So it looks like it doesn't know the % expression.
Why is that? I got funkySetFields using svn, executed insertGenerated.sh and compiled it. It did give some warnings while compiling though..
Do you have some advice what is wrong here?
Cheers, Sara

sara December 2, 2008 22:11

Ps I had a look at the ValueE
 
Ps
I had a look at the ValueExpressionLexer.ll where all the expression syntax is in. I didn't see the module operator in there.
Am I looking for the wrong ( = old) version?
I got the one from the wiki which says:
The most recent version of the sources....
Should be alright, shouldn't it?
Cheers, Sara

gschaider December 3, 2008 13:37

Hi Sara! The Version of FSF
 
Hi Sara!

The Version of FSF I'm currently maintaining is the one in the 1.5-svn (the first one in the Download-section on the Wiki)

Forgot to add the generated files. Added them to the SVN

Bernhard

sara December 3, 2008 21:13

Thanks Bernhard It works fine
 
Thanks Bernhard
It works fine now.
Cheers, Sara


All times are GMT -4. The time now is 00:06.