|
[Sponsors] |
April 11, 2015, 14:10 |
Display center of mass with mesh
|
#1 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
Hye please help me i solved center of mass in (x,y,z) format now i want to watch it in paraFoam. anyone knows something about it????
|
|
April 18, 2015, 17:07 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quick answer: Please provide more details, as explained here: http://www.cfd-online.com/Forums/ope...-get-help.html
Because the simplest answer is this - In ParaView, you should:
|
|
April 18, 2015, 22:48 |
|
#3 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
But sir problem is that value of center of mass is changing contonously with runtime. Thats why i want to make some change in solver to see center of mass. please help me if you can.......
|
|
April 19, 2015, 11:49 |
|
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
I or anyone else can help you, but only if you provide more details! Keep in mind that your question is too generic and we are not able to see what you are seeing.
At the very least, provide an example file of the data you want to plot and see in ParaView! |
|
April 19, 2015, 13:14 |
|
#5 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
Actually sir, just think about damBreak case..... In interFoam case i added
CoM = sum(rho*mesh.V()*mesh.C().dimensionedInternalField ())/sum(rho*mesh.V()); and defined CoM as a vector dimensionedVector CoM("CoM", dimLength, vector::zero); now it gives me center of mass of fluid suppose in dambreak case. But it gives me in log file. in form of Vector (a,b,c). Value of center of mass of fluid changes with movement of fluid in paraFoam. I want to watch position of center of mass at every time step. so i want position of center of mass in mesh. |
|
April 19, 2015, 13:53 |
|
#6 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quick answer:
Good luck! Last edited by wyldckat; April 19, 2015 at 14:41. Reason: Removed "and here" |
|
April 19, 2015, 13:55 |
|
#7 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
Thank you sir. these things are quite informative. i like that. thanks you again
|
|
April 19, 2015, 14:00 |
|
#8 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
sir you forget to write after (and here). The link needed
|
|
April 19, 2015, 14:43 |
|
#9 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Sorry, I actually forgot to remove the initial text for the 2nd reference "and here", because after searching for a while, I didn't find any good example. It's one of those so very simple coding exercises, that should be already present in one or more C++ tutorials. For example: http://www.cplusplus.com/doc/tutorial/files/
|
|
April 20, 2015, 10:33 |
|
#10 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
Sir i tried to do as you said. but the problem is that it shows all sphares at a time. i want to watch center of mass moving at runtime. but the method you specified gives all locations of center of mass at a time.
i am attaching the image with this thread. |
|
April 26, 2015, 16:40 |
|
#11 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi 13msmemusman,
The following took me some considerable time to program. Steps to use:
My test file "test.csv" contains this: Code:
Time, X, Y, Z 0, 0, 0, 0 1, 0.1, 0.2, 0.3 2, 0.2, 0.3, 0.4 Bruno PS: I wrote this code based on the examples given here:
__________________
|
|
April 27, 2015, 13:43 |
|
#12 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
thank you sir you did so much for me. but there is an error.
Code:
Traceback (most recent call last): File "<string>", line 20, in <module> File "<string>", line 5, in RequestData ImportError: No module named numpy Last edited by wyldckat; April 27, 2015 at 16:06. Reason: Added [CODE][/CODE] markers |
|
April 27, 2015, 16:07 |
|
#13 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Muhammad,
Looks like "numpy" isn't installed. A few questions:
Bruno |
|
April 28, 2015, 12:32 |
|
#14 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
Sir now i have installed numpy and now error is
Code:
not defined Traceback (most recent call last): File "<string>", line 20, in <module> File "<string>", line 28, in RequestData ValueError: field named Time not found This is ubuntu 14 and openfoam 2.3.1 and paraFoam 4.1.0 i followed instructions by openfoam.org Last edited by wyldckat; April 30, 2015 at 12:28. Reason: Added [CODE][/CODE] markers |
|
April 29, 2015, 02:50 |
|
#15 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
there was problem in file format. i have corrected. but still i have a problem. i doesn't give me error but it don't show me center of mass
|
|
May 3, 2015, 10:46 |
|
#16 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Attached are two images, tested with the tutorial case "incompressible/icoFoam/cavity":
|
|
May 3, 2015, 10:50 |
|
#17 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
Sir i am using it in interFoam.... let me try again....
|
|
May 3, 2015, 11:01 |
|
#18 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
p, li { white-space: pre-wrap; } not defined
Traceback (most recent call last): File "<string>", line 20, in <module> File "<string>", line 28, in RequestData ValueError: field named Time not found Error sir.... please save the state in paraFoam and send me at 13msmemusman@smme.edu.pk |
|
May 3, 2015, 12:12 |
|
#19 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
Thank you boss..... i have also done it successfully
|
|
May 3, 2015, 12:26 |
|
#20 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Attached is a complete example case, which is the "cavity" I mentioned before case.
Unpack it and then run: Code:
./Allrun pwd paraview When you open it, it will show a window similar to the attached image. You'll need to change the path to the folder given in the second command. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
decomposePar problem: Cell 0contains face labels out of range | vaina74 | OpenFOAM Pre-Processing | 37 | July 20, 2020 06:38 |
Prescribed Translating Cylinder Mesh for Added Mass Problem (Transient FSI) | Lloyd Sullivan | CFX | 5 | August 7, 2018 09:11 |
Gambit problems | Althea | FLUENT | 22 | January 4, 2017 04:19 |
Star CCM Overset Mesh Error (Rotating Turbine) | thezack | Siemens | 7 | October 12, 2016 12:14 |
How to control Minximum mesh space? | hung | FLUENT | 7 | April 18, 2005 10:38 |