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] need funkysetfields to creat a droplet (https://www.cfd-online.com/Forums/openfoam-community-contributions/98052-need-funkysetfields-creat-droplet.html)

Zuixy May 24, 2012 06:46

Thank you. You helped me a lot. I think i understand now how it works.

Unfortunately it doesn't work at all with potentialWaveFoam. I try to figure out why and will post it, if i succeed.



S.Jafari December 15, 2012 04:43

swak4foam
 
hi
im new in openFoam too. im trying to simulate falling droplet. for having a set of results i use swak4foam to get the information of field deitalls. i wrote the function for calculating mass center of falling drop. now i want to find some other variables in each time step (such as velocity) using the mass center that i found as i said.
explaining more:
i wrote function for calculating mass center in each step time (x)
now i want to use x to calculate velocity in this formulation: v=[x(2)-x(1)]/deltaT
how can i match these function in control dict?

gschaider December 16, 2012 19:32

Quote:

Originally Posted by S.Jafari (Post 397657)
hi
im new in openFoam too. im trying to simulate falling droplet. for having a set of results i use swak4foam to get the information of field deitalls. i wrote the function for calculating mass center of falling drop. now i want to find some other variables in each time step (such as velocity) using the mass center that i found as i said.
explaining more:
i wrote function for calculating mass center in each step time (x)
now i want to use x to calculate velocity in this formulation: v=[x(2)-x(1)]/deltaT
how can i match these function in control dict?

One possibility would be to use a storedVariable (this is just a sketch):

Code:

variables (
  "newPos= <however you calculate your mass centern>;"
  "velocity=(newPos-oldPos)/deltaT();"
  "oldPos=newPos;"
);
expression "velocity";
storedVariables (
  {
    name oldPos;
    initialValue "vector(0,0,0)";
);

Initial value is the tricky part because that might cause a velocity "jump" in the beginning

Or you can always load the positions you calculated into a spreadsheet and do the calculation there

nimasam December 17, 2012 01:39

missed a }
thank you for your reply
Quote:

variables ( "newPos= <however you calculate your mass centern>;" "velocity=(newPos-oldPos)/deltaT();" "oldPos=newPos;" ); expression "velocity"; storedVariables ( { name oldPos; initialValue "vector(0,0,0)";
}
);


gschaider December 17, 2012 04:16

Quote:

Originally Posted by nimasam (Post 397835)
missed a }
thank you for your reply

That's what I mean with "just a sketch" ;)

S.Jafari December 20, 2012 04:53

thank you so much for the answer :)

mecman August 4, 2013 05:57

Hi all
i want use of FunkySetFields for may case in OpenFoam2.1.1,i instal swak4Foam for this version witout problem,i made FunkySetFieldsDict for my case and after when i run that i see this problem

--> FOAM FATAL ERROR:
funkySetFields: time/latestTime option is required
From function main()
in file funkySetFields.C at line 641.
FOAM exiting
what is my mistake?

nimasam August 4, 2013 06:08

you should enter time argument
Quote:

funkySetFields -time 0

mecman August 4, 2013 11:40

Quote:

Originally Posted by nimasam (Post 443699)
you should enter time argument

thnax nima...i found it...


All times are GMT -4. The time now is 12:30.