CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   how to output reslut along multiple lines (https://www.cfd-online.com/Forums/openfoam-post-processing/196772-how-output-reslut-along-multiple-lines.html)

bingchuan December 15, 2017 03:49

how to output reslut along multiple lines
 
Hi,

As we know, we can output results along a line using function singleGraph. We can define the start and end points in it. My question is how to output the results along multiple lines? Can I modify the singleGraph file like:
.....
start (x11, y11,z11);
end (x12,y12,z12);
fileds (U p);

start (x21,y21,z21);
end (x22,y22,z22);
fileds (U p);
...
where (x1i, y1i, z1i) are the start and end of the first line, (x2i, y2i, z2i) are the start and end of the second line.

Thanks.

Bingchuan

rajan19us December 15, 2017 08:50

Just extract the data of 2 different plots in .csv file and then import in excel. In excel, you can combine both the graphs in a single figure.

Regards,
Rajan

blebon December 15, 2017 10:51

This is the sort of thing that can be easily implemented in Python. Read the outputs from multiple line graphs and concatenate them.

bingchuan December 19, 2017 03:39

Thanks Rajan.
Thanks Bruno.

Sorry, I didn't clarify my question clearly.
http://photo.weibo.com/2626942817/wb...qgrj20hb0c6aa4
I was doing an unsteady simulition. Since the computational dimain is three dimensional, so I am going to write the results of the whole computional domain in large time interval. But the results along some lines need to be monitored during small time interval (e.g. line 1 and 2 in the sketch). So it is improssblie to extract data from the whole domain like Rajan said.

I planed to use the function objects singleGraph included by the "casedir/system/controlDict" , i.e.
...
funcitons
{
#includeFunc singleGraph
}
...
as recommend by https://cfd.direct/openfoam/user-gui...hs-monitoring/.

It works when sampling data along a line. However, I don't know how to sample data along a few lines just like line 1 and 2 in the sketch above.

Bests,
Bingchuan

bingchuan December 19, 2017 03:42

Sorry, I failed to upload the sketch.
http://http://photo.weibo.com/262694...34018797072574
You can go to https://pan.baidu.com/s/1dEP3X7N
https://pan.baidu.com/s/1dEP3X7N

blebon December 19, 2017 04:23

You need two simpleGraphs in your system directory. Just rename the template files to different file names, for example simpleGraph1 and simpleGraph2 and then include them in the controlDict.

functions
{
#includeFunc singleGraph1
#includeFunc singleGraph2
}

bingchuan December 19, 2017 05:48

Quote:

Originally Posted by blebon (Post 675534)
You need two simpleGraphs in your system directory. Just rename the template files to different file names, for example simpleGraph1 and simpleGraph2 and then include them in the controlDict.

functions
{
#includeFunc singleGraph1
#includeFunc singleGraph2
}

It works.
Thank you Bruno.

Bests,
Bingchuan

Saulhr September 16, 2020 11:08

fatal error with singleGraph1
 
I used the @blebon strategy but singleGraph1 is not a "type" that is allowed. Therefore, it is a fatal error.

@Bingchuan you succeeded is your task?

I'm trying to do the same thing.

rhommel1 November 1, 2021 10:27

Solution
 
This was over two years ago, but for the future Bingchuan's solution does work if you have two files labeled singleGraph1 and singleGraph2 in your system directory. You can actually do this with infinitely many single graphs (I have tested up to 50).


All times are GMT -4. The time now is 23:15.