|
[Sponsors] |
How to extract the data of all cells in the domain |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 7, 2020, 14:06 |
How to extract the data of all cells in the domain
|
#1 |
New Member
Bssam
Join Date: Nov 2019
Posts: 19
Rep Power: 6 |
Hi
It is a simple question. Suppose that we have a 2D domain That consists of 9 cells for example (imagine a square of 9 cells) Then I want to extract the data of the temperature field at each cell and the corresponding data of another field (say mixture fraction Z) in that way I have the full data of each cell in terms of (Tcell,Zcell) How to do this? |
|
May 7, 2020, 17:36 |
|
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12 |
I am not sure if I understood your question, so my apologies.
Information within a numerical domain can be interrogated by many means in OpenFOAM: e.g. sample, and probe utilities. Please do search them.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
May 7, 2020, 19:59 |
|
#3 |
New Member
Bssam
Join Date: Nov 2019
Posts: 19
Rep Power: 6 |
Amazing that really worked. To extract the whole information of the field in a mesh: select > filter > data analysis > probe location > press ok whatever the settings are > then chang the tab "showing" and select your mesh. Finally, save in a csv file.
All the best |
|
May 8, 2020, 03:44 |
|
#4 |
Senior Member
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 11 |
If I correctly understand your demand, there is a utility to deal with such things in my GitHub:
https://github.com/ZhangYanTJU/foam2Columns It supports any number of fields and transforms them to this format: Code:
L1: x y z var1 var2 ... L2: x y z var1 var2 ... . . . Ln: x y z var1 var2 ... Code:
foam2Columns -fields "(p T)"
__________________
https://openfoam.top |
|
May 8, 2020, 22:08 |
|
#5 | |
New Member
Bssam
Join Date: Nov 2019
Posts: 19
Rep Power: 6 |
Quote:
What an elegant function is this! That exactly what I meant. Also, this function does more than I need which it also specifies the location x y z. The method I mentioned in my comment also works but it is not as easy as this function! So awesome, I will give it a try for sure 👌🏻 |
||
May 8, 2020, 22:10 |
|
#6 |
New Member
Bssam
Join Date: Nov 2019
Posts: 19
Rep Power: 6 |
That is why I like OpenFOAM. The room for improvement is endless! And collaboration is very effective in the scientific community 🙏
|
|
May 13, 2020, 13:08 |
How to extract the data of all cells in the domain
|
#7 |
Senior Member
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 120
Rep Power: 15 |
Dear zhangyan,
I downloaded foam2Columns into home/run folder. After unzipping and compiling I used it for dambreak case. Using the foam2Columns -fields "(p_rgh)" gives me all info that was proposed. But the execution of the foam2Columns -fields "(alfa.water)" gives nothing. In another words everything is fine for p_rgh? not for alfa.water. I am using openfoam 7 on ubuntu 16.04 LTS Any kind of help is highly appreciated. Kerim |
|
May 14, 2020, 05:17 |
|
#8 | |
Senior Member
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 11 |
Quote:
1. Did you type it right? Isn't it alpha.water? 2. Now the foam2Cloumns tool only supports for volScalarField. Is alpha.water a volScalarField?
__________________
https://openfoam.top |
||
May 14, 2020, 10:54 |
|
#9 | |
Senior Member
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 120
Rep Power: 15 |
Quote:
1. Yes I did it right. 2. alfa.water is volScalarField. By the way, after execution of the command foam2Columns -fields "(alfa.water)" in the terminal I got a file alphaPhi0.water. But it is not that file I am looking for. Frakly speaking I don't understand what kind of file I got. Please see attachments for more information. Kerim alfa.water.jpg alfa.water1.jpg alfa.water2.jpg alphaPhi0.water.jpg p_rgh.jpg |
||
May 14, 2020, 11:23 |
|
#10 |
Senior Member
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 120
Rep Power: 15 |
Dear zhangyan,
I just used foam2Cloumns tool for bouyantCavity case which uses buoyantSimpleFoam solver. Direct application of foam2Cloumns tool gives an error keyword PIMPLE is undefined in dictionary "/home/kerim/run/buoyantCavity/system/fvSolution". As you know buoyantSimpleFoam solver use only SIMPLE, not PIMPLE. After changing SIMPLE to PIMPLE I got foam2Columns_p_T file. That is what I was looking for. Could you explain me why do I have above mentioned error? Kerim bouyantCavity-1.jpg bouyanCavity-2.jpg |
|
May 14, 2020, 17:53 |
|
#11 | |
Senior Member
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 11 |
Quote:
But I found it from the last picture, at 0.5 s, you only got alpha.water. I don't know why you want to try alfa.water.
__________________
https://openfoam.top |
||
May 14, 2020, 17:54 |
|
#12 | |
Senior Member
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 11 |
Quote:
It will give me a chance to improve this tool. I'll check it soon.
__________________
https://openfoam.top |
||
May 14, 2020, 18:57 |
|
#13 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,685
Rep Power: 40 |
Quote:
https://www.openfoam.com/documentati...t.html#details |
||
May 15, 2020, 00:25 |
|
#14 | |
Senior Member
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 120
Rep Power: 15 |
Quote:
Dear Zhangyan, Alfa.water helps to determine the position of free surface between two fluids - water and air. The value of alfa.water=.05 represents free surface and that is why I need to extract from OpenFOAM alfa.water by using foam2Columns tool. Kerim |
||
May 15, 2020, 00:28 |
|
#15 |
Senior Member
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 120
Rep Power: 15 |
||
May 15, 2020, 04:09 |
|
#16 | |
Senior Member
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 11 |
Quote:
Code:
foam2Columns -fields "(alpha.water)
__________________
https://openfoam.top |
||
May 15, 2020, 05:47 |
|
#17 | |
Senior Member
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 120
Rep Power: 15 |
Quote:
Dear Zhangyan, Right now I have reinstalled ubuntu 16.04.6 LTS 64 bit, OpenFoam 7 and foam2Columns. Than I copied alpha.water from 0 folder and pasted in terminal. After execution of the command foam2Columns -fields "(alpha.water)" I got foam2Columns_alpha.water file I was looking for. Frankly speaking I don't understand of the reason of my previous mistakes. Now everything is OK with foam2Columns tool. Please see the attached figures. Thanks a lot to you. Your help is highly appreciated. It will be great to expand foam2Columns for volVectorField quantity like velocity. Kerim alpha.water-1.jpg alpha.water-2.jpg alpha.water-3.jpg alpha.water-4.jpg picture-wmake.jpg |
||
September 8, 2020, 12:47 |
|
#18 | |
Senior Member
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 11 |
Hi,
Now it supports for volVectorField! https://github.com/ZhangYanTJU/foam2Columns Quote:
__________________
https://openfoam.top |
||
September 9, 2020, 01:23 |
|
#19 | |
Senior Member
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 120
Rep Power: 15 |
Quote:
Thanks a lot to you. Your help will be highly appreciated bythe OpenFOAM community. |
||
November 19, 2020, 22:21 |
|
#20 | |
Senior Member
Join Date: Jul 2019
Posts: 148
Rep Power: 6 |
Quote:
I am wondering if foam2Columns works for OpenFOAM v6. I tried to compile the code with wmake but I got the below error. Code:
Making dependency list for source file foam2Columns.C g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam6/src/finiteVolume/lnInclude -I/opt/openfoam6/src/meshTools/lnInclude -I/opt/openfoam6/src/sampling/lnInclude -I/opt/openfoam6/src/lagrangian/basic/lnInclude -IlnInclude -I. -I/opt/openfoam6/src/OpenFOAM/lnInclude -I/opt/openfoam6/src/OSspecific/POSIX/lnInclude -fPIC -c foam2Columns.C -o Make/linux64GccDPInt32Opt/foam2Columns.o foam2Columns.C: In function ‘int main(int, char**)’: foam2Columns.C:109:21: error: ‘fileType’ has not been declared fileType::directory ^~~~~~~~ /opt/openfoam6/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/foam2Columns.o' failed make: *** [Make/linux64GccDPInt32Opt/foam2Columns.o] Error 1 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] snappyHexMesh sticking point | natty_king | OpenFOAM Meshing & Mesh Conversion | 11 | February 20, 2024 09:12 |
Foam::error::PrintStack | almir | OpenFOAM Running, Solving & CFD | 91 | December 21, 2022 04:50 |
[ICEM] Error in mesh writing | helios | ANSYS Meshing & Geometry | 21 | August 19, 2021 14:18 |
cellZone not taking all the cells inside | rahulksoni | OpenFOAM Running, Solving & CFD | 6 | January 25, 2019 00:11 |
[snappyHexMesh] external flow with snappyHexMesh | chelvistero | OpenFOAM Meshing & Mesh Conversion | 11 | January 15, 2010 19:43 |