# swak4foam

 Register Blogs Members List Search Today's Posts Mark Forums Read

 May 24, 2012, 06:46 #21 New Member   Tom Schmitz Join Date: Mar 2011 Posts: 19 Rep Power: 7 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.

 December 15, 2012, 05:43 swak4foam #22 New Member   Sahar Join Date: Oct 2012 Posts: 2 Rep Power: 0 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?

December 16, 2012, 20:32
#23
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,931
Rep Power: 41
Quote:
 Originally Posted by S.Jafari 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
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

December 17, 2012, 02:39
#24
Senior Member

Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,193
Blog Entries: 1
Rep Power: 16
missed a }
Quote:
 variables ( "newPos= ;" "velocity=(newPos-oldPos)/deltaT();" "oldPos=newPos;" ); expression "velocity"; storedVariables ( { name oldPos; initialValue "vector(0,0,0)"; } );
__________________
Telegram channel (https://telegram.me/openfoam4Iranian)
My Weblog (http://openfoam.blogfa.com/)
Training Course on OpenFOAM at (http://www.isme.ir/)

December 17, 2012, 05:16
#25
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,931
Rep Power: 41
Quote:
 Originally Posted by nimasam missed a } thank you for your reply
That's what I mean with "just a sketch"
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

 December 20, 2012, 05:53 #26 New Member   Sahar Join Date: Oct 2012 Posts: 2 Rep Power: 0 thank you so much for the answer

 August 4, 2013, 05:57 #27 Member   Mohammad Bahreini Join Date: Dec 2012 Posts: 36 Rep Power: 5 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?

August 4, 2013, 06:08
#28
Senior Member

Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,193
Blog Entries: 1
Rep Power: 16
you should enter time argument
Quote:
 funkySetFields -time 0
__________________
Telegram channel (https://telegram.me/openfoam4Iranian)
My Weblog (http://openfoam.blogfa.com/)
Training Course on OpenFOAM at (http://www.isme.ir/)

August 4, 2013, 11:40
#29
Member

Join Date: Dec 2012
Posts: 36
Rep Power: 5
Quote:
 Originally Posted by nimasam you should enter time argument
thnax nima...i found it...

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post GGerber OpenFOAM Installation 54 April 24, 2015 16:02 gschaider OpenFOAM 164 January 13, 2015 03:52 ganeshv OpenFOAM Running, Solving & CFD 5 November 11, 2011 17:39 miles_davis OpenFOAM Pre-Processing 7 October 5, 2011 11:57 andrea.pasquali OpenFOAM 3 August 30, 2011 11:24

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