CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

interFoam : post processing

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By Bernhard

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 20, 2012, 07:16
Default interFoam : post processing
  #1
New Member
 
yudhast
Join Date: Mar 2011
Posts: 12
Rep Power: 15
udiitm is on a distinguished road
Hi,

I want to collect the cell information on the basis of alpha value ( 0.5 i.e. at interface) and the pressure at nearby cells with their x and y co-ordinates.
The information i have to get is interface.sigmaK())*fvc::snGrad(alpha1)
in the part

fvc::interpolate(interface.sigmaK())*fvc::snGrad(a lpha1)

- ghf*fvc::snGrad(rho)

Please tell me how to extract these information?
I need the information in the following format:
for each value of alpha=0.5 i.e at interface

Co- ordinates.... value of sigmaK* grad(alpha)....... Value of pressure at near by cells
X Y................... (as mentioned above).................. p1 p2 p3 p4

regards,
Yudhast

Last edited by udiitm; February 21, 2012 at 02:06.
udiitm is offline   Reply With Quote

Old   February 20, 2012, 09:22
Default
  #2
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
What is your question?
Bernhard is offline   Reply With Quote

Old   February 21, 2012, 02:10
Default
  #3
New Member
 
yudhast
Join Date: Mar 2011
Posts: 12
Rep Power: 15
udiitm is on a distinguished road
Dear Bernhard,
Sorry for the incomplete thread...My question is how to get the information of Cell at interface and the corresponding value of sigmaK*grad(alpha) and pressure value at near by cell as i have edited in original thread?

Thanks
Yudhast
udiitm is offline   Reply With Quote

Old   February 21, 2012, 04:11
Default
  #4
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
The easiest would be to do this during runtime.

Create a volVectorField (name X here), like for U in createFields.H (only replace MUST_READ by NO_READ)

Then you can easily write
X=interface.sigmaK()*fvc::grad(alpha1)
or
X=fvc::reconstruct( fvc::interpolate(interface.sigmaK() ) * fvc::snGrad(alpha1) )

This should be enough to recompile. During runtime you will now create a field X.

You can combine this with sampling during runtime put this in your controlDict
Code:
functions
(
    interface
    {   
        type            surfaces;
        functionObjectLibs
        (   
            "libsampling.so" 
        );  
        outputControl   outputTime;
        outputInterval  1;  
        surfaceFormat  vtk;
        fields
        (   
            alpha1
            X
        );  
        surfaces
        (   
            freeSurface
            {   
                type        isoSurfaceCell;
                isoField    alpha1;
                isoValue    0.5;
                interpolate false;
                regularise  false;
            }   
        );  
        interpolationScheme cell;
    } 
);
Which basically creates an iso-surface at alpha1=0.5, and interpolates X to it. The resulting vtk files can easily be read in ParaView,

Good luck!
angelmonsalve, Ellie and katete like this.

Last edited by Bernhard; February 21, 2012 at 06:32.
Bernhard is offline   Reply With Quote

Old   February 23, 2012, 05:58
Default
  #5
New Member
 
yudhast
Join Date: Mar 2011
Posts: 12
Rep Power: 15
udiitm is on a distinguished road
Dear Bernhard,

Thanks for your reply. I have tried to compile the changes in createField.H but got an error:

error: ‘interface’ was not declared in this scope

when i used the expression for "X" i.e.

X=fvc::interpolate(interface.sigmaK())*fvc::snGrad (alpha1) 'OR'
X=fvc::reconstruct(fvc::interpolate(interface.sigm aK())*fvc::snGrad(alpha1))

Regards,
Yudhast
udiitm is offline   Reply With Quote

Old   February 23, 2012, 06:32
Default
  #6
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
My excuses for being incomplete in my previous post.

In createFields.H you only create the field X as you create U (just to have it somewhere available)

You want to update and store the value for X each timestep, so your expression should be inside the timeloop. createFields is of course only executed once, before the simulation really starts. I would put it in the main file (interFoam.C), just in front of runTime.write(). (Also give it a name different from X, to make it more or less self-explanatory for future users)

Finally, it is always a good idea to carefully read the errormessages of the compiler, since they give a good explanation on where to find the error. As interface was not declared, I suppose you put the line with X higher than line 87 of createFields.H.
Bernhard is offline   Reply With Quote

Old   March 2, 2012, 01:30
Default
  #7
New Member
 
yudhast
Join Date: Mar 2011
Posts: 12
Rep Power: 15
udiitm is on a distinguished road
Dear Bernhard,

Thanks for your reply.
your suggestion was very helpful for solving my problem

Regards,
yuhdast
udiitm is offline   Reply With Quote

Old   March 21, 2012, 06:47
Default
  #8
New Member
 
yudhast
Join Date: Mar 2011
Posts: 12
Rep Power: 15
udiitm is on a distinguished road
Dear Bernhard,
Thanks for your suggestion.
Now I want to get the information of cells ( elements) which contains some value for the variable "X" calculated by above steps.
I am actually looking for the neighbour cells for the cells containing non-zero value of variable "X" to manipulate pressure and other values. i.e.

suppose for cell(i,j) with X = non-zero value
I need pressure (P) for cells ( i+1,j ; i-1,j ; i,j-1 ; i,j+1 ; i,j-1)

Thanks and Regards,
Yudhast
udiitm is offline   Reply With Quote

Old   August 11, 2015, 19:10
Default
  #9
New Member
 
Angel Monsalve
Join Date: Oct 2009
Posts: 7
Rep Power: 17
angelmonsalve is on a distinguished road
Thanks for this explanation!! couple of years later but works pretty well
angelmonsalve is offline   Reply With Quote

Reply

Tags
cell information, interface, interfoam, post processing


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ansys Post processing ano999 ANSYS 1 May 27, 2011 17:24
NO model vs post processing in coal combustion,CFX sakalido CFX 1 April 15, 2011 15:07
post processing for KIVA dirga Main CFD Forum 5 April 23, 2009 11:58
Post Processing in FEM Abhijit Tilak Main CFD Forum 0 April 26, 2004 12:59
post processing in CFD MANISH BHARGAVA Main CFD Forum 0 October 17, 1998 21:51


All times are GMT -4. The time now is 04:47.