|
[Sponsors] |
How to read velocity fields to do mathematical operations |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 18, 2016, 11:10 |
How to read velocity fields to do mathematical operations
|
#1 |
New Member
Saddam Hijazi
Join Date: May 2016
Posts: 17
Rep Power: 9 |
Hello all, I want to do some post processing stuff in openfoam where I am trying to write a routine in C language that reads a matrix and velocity fields written in openfoam format and what I need to do is just to multiply each velocity vectors of them by an element of the matrix which I read and then sum up all of them and write the result back in openfoam format, I have my velocity files and the matrix all in the 0 folder of the simulation, so could help me in giving directions in how to do that.
Thank you very much. |
|
July 20, 2016, 04:14 |
|
#2 | |
New Member
Join Date: May 2016
Posts: 28
Rep Power: 9 |
Quote:
Hello SaddamH, I didn't undestand: is your problem related to how compute the operations you listed, or only to how write results in OpenFOAM format? In the last case, you just need to copy the U file and put the values you find in the correct patch. e.g. if the data are related to inlet, type: inlet { type fixedValue; value nonUniform list <scalar> ( *your data* ) } |
||
July 20, 2016, 06:01 |
|
#3 | |
New Member
Saddam Hijazi
Join Date: May 2016
Posts: 17
Rep Power: 9 |
Quote:
I wanted to import velocity files from Openfoam and then do some operations on them and then output them again in OF format for the first thing, I have found this thread http://www.cfd-online.com/Forums/ope...rocessing.html in the archive in which it is written some matlab functions to import the fields needed from OF but for the other way around I tried to make it on my own by writing the values in .txt format, I don't know whether this will work or not since I am interested at the end in visualizing the new fields using paraview one thing important, I have many files to do this operation in both directions so it is not convenient to do it manually |
||
July 20, 2016, 06:19 |
|
#4 | |
New Member
Join Date: May 2016
Posts: 28
Rep Power: 9 |
Quote:
For the second part, you have to modify the files in your 0 or latest time directory as I said in my first post and it will appear this quantity in paraview |
||
June 7, 2019, 10:53 |
|
#5 |
New Member
Josh Williams
Join Date: Jun 2018
Location: Scotland
Posts: 8
Rep Power: 7 |
Did anyone find a solution to this?
|
|
June 19, 2019, 06:33 |
|
#6 |
Senior Member
Zander Meiring
Join Date: Jul 2018
Posts: 125
Rep Power: 7 |
depending on the opperation you want to perform, you can use the calculator filter in paraview
|
|
June 19, 2019, 08:57 |
|
#7 |
New Member
Josh Williams
Join Date: Jun 2018
Location: Scotland
Posts: 8
Rep Power: 7 |
Thanks, I used the calculator filter in paraview to multiply velocity of a surface cut by the normal of that surface (input manually using iHat, jHat, kHat) - for anyone with this issue in future.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] How to read in fields from previous time-steps in swak4foam | Mehrez | OpenFOAM Community Contributions | 8 | May 24, 2016 16:36 |
Question on Pressure and Velocity Fields with SIMPLE algorithm | Phiper | Main CFD Forum | 0 | November 18, 2010 18:29 |
UDF for space-filtering 3-D velocity fields | Xianmin | FLUENT | 0 | April 11, 2008 20:58 |
How to read a file with inlet velocity data? | dorin | CFX | 13 | July 20, 2007 02:16 |
what the result is negatif pressure at inlet | chong chee nan | FLUENT | 0 | December 29, 2001 05:13 |