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

Homogeneous Average

Register Blogs Community New Posts Updated Threads Search

Like Tree12Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 14, 2010, 11:45
Default Update version
  #21
Member
 
Frederic Collonval
Join Date: Apr 2009
Location: Technische Universitaet Munich - Lehrstuhl fuer Thermodynamik
Posts: 53
Rep Power: 17
fcollonv is on a distinguished road
Hello everybody,

I updated the tool to average value in an homogeneous direction in order to remove this strange parameter nPoints.

For that the class "midPointSet" is used instead of "uniform" that implies that only one value by cell in the homogeneous direction will be used to compute the average.

I haven't unfortunately so much time to test it. So feel free to do so and send your feed back please.

Best regards,

Frédéric
Attached Files
File Type: gz sampledAveragePlane2.tar.gz (40.0 KB, 124 views)
pyt and y_jiang like this.
fcollonv is offline   Reply With Quote

Old   September 6, 2010, 10:50
Default
  #22
New Member
 
zakk
Join Date: Jun 2009
Posts: 10
Rep Power: 16
arslantuf is on a distinguished road
I am trying to use the script sampledAveragePlane. I m receiving that error while in compiling. Can somebody figure out the reason?
Thank you

g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/tufan/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -I/home/tufan/OpenFOAM/OpenFOAM-1.6/src/meshTools/lnInclude -I/home/tufan/OpenFOAM/OpenFOAM-1.6/src/sampling/lnInclude -I/home/tufan/OpenFOAM/OpenFOAM-1.6/src/surfMesh/lnInclude -I/home/tufan/OpenFOAM/OpenFOAM-1.6/src/triSurface/lnInclude -I/home/tufan/OpenFOAM/OpenFOAM-1.6/src/lagrangian/basic/lnInclude -IlnInclude -I. -I/home/tufan/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/tufan/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC Make/linux64GccDPOpt/sampledAveragePlane.o -L/home/tufan/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt \
-lfiniteVolume -lmeshTools -lsampling -lsurfMesh -ltriSurface -llagrangian -lOpenFOAM -liberty -ldl -lm -o /home/tufan/OpenFOAM/tufan-1.6/applications/bin/linux64GccDPOpt/sampledAveragePlane
/usr/lib/../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [/home/tufan/OpenFOAM/tufan-1.6/applications/bin/linux64GccDPOpt/sampledAveragePlane] Error 1
arslantuf is offline   Reply With Quote

Old   September 9, 2010, 04:22
Default
  #23
Member
 
Frederic Collonval
Join Date: Apr 2009
Location: Technische Universitaet Munich - Lehrstuhl fuer Thermodynamik
Posts: 53
Rep Power: 17
fcollonv is on a distinguished road
Hello Tufan

Quote:
Originally Posted by arslantuf View Post
I am trying to use the script sampledAveragePlane. I m receiving that error while in compiling. Can somebody figure out the reason?
This tool is not an application but a function to be used with the "sample" tool. So to compile it you have to used the option "libso" (wmake libso/wclean libso) to produced a library.

As mentioned in the README file the best is to copy the source files in the directory $FOAM_SRC/sampling/sampledSurface.
However if you don't have the right to do so, you can copy the Make folder $FOAM_SRC/sampling/Make. Then change the "options" and "file" files to compile the new function in a library (cf. paragraph 3.2. p.71 User's Guide)


Best regards,

Frédéric
fcollonv is offline   Reply With Quote

Old   September 10, 2010, 10:40
Default
  #24
New Member
 
zakk
Join Date: Jun 2009
Posts: 10
Rep Power: 16
arslantuf is on a distinguished road
Hi Fabian,

How did you handle it in Tecplot. I am using the version 360 -2009

Thank you


Quote:
Originally Posted by fs82 View Post
Hello Frederic,

thx a lot that you try to fix my problem. After spending two days of work on this topic, I decided to use tecplot. I now sample the same line for different z-positions and average this with tecplot. This works quite good and is reliable. I need the averages just for comparison to an article and to adjust my OpenFoam setting for the cylinder les. But I want to test OpenFoam 1.6 in a while, so I will test your scipt with the new version of OpenFoam.

kind regards,

Fabian
arslantuf is offline   Reply With Quote

Old   September 10, 2010, 12:38
Default
  #25
New Member
 
zakk
Join Date: Jun 2009
Posts: 10
Rep Power: 16
arslantuf is on a distinguished road
Hi Frédéric,

I have just figured out that after I sent my query. Thank you for explanation. I tried the utility in Of 1.6 with structured mesh . It is working well. But my is different. Flow around the square and trying to get spanwise ( z direction) avarages. The mesh is unstructured in X-Y plane as it is seen in figure. But it is extruded in Z direction so it is structured in Z direction ( layer by layer)

Finally the script is not working in this case. what is your opinion? Is it necessary to modify it? Is it possible to make it run for this kind of mesh?

Thank you

Zakk

Quote:
Originally Posted by fcollonv View Post
Hello Tufan



This tool is not an application but a function to be used with the "sample" tool. So to compile it you have to used the option "libso" (wmake libso/wclean libso) to produced a library.

As mentioned in the README file the best is to copy the source files in the directory $FOAM_SRC/sampling/sampledSurface.
However if you don't have the right to do so, you can copy the Make folder $FOAM_SRC/sampling/Make. Then change the "options" and "file" files to compile the new function in a library (cf. paragraph 3.2. p.71 User's Guide)


Best regards,

Frédéric
Attached Images
File Type: jpg mesh.jpg (94.4 KB, 62 views)
arslantuf is offline   Reply With Quote

Old   October 11, 2010, 13:41
Default
  #26
Member
 
Kim Yusik
Join Date: Dec 2009
Posts: 39
Rep Power: 16
impecca is on a distinguished road
Dear Frédéric

Is the reason that you changed 'uniform' to 'midPoint' set because the profile generated from your previous version has some small structure on the profile? (because I always have some small strucutre on profile using your fuction)
If this is the reason, I think this is really good fuction.
I use a lot of your (previous) code, I appreicate your work.

For the latest version of your code, it seems that this fuction averages in all values in homogeneous direction. So it takes quiet a time to average comparing to lats version. (in my case it doesn't work)

So I thinks it is much useful, if there is 'sampledAverageSet' to average at only one line for the big simulation. If you have any plane for making this function, it will be grateful and hopely it can be shared.

Thanks again for your work.
impecca is offline   Reply With Quote

Old   October 18, 2010, 15:22
Default
  #27
Member
 
Frederic Collonval
Join Date: Apr 2009
Location: Technische Universitaet Munich - Lehrstuhl fuer Thermodynamik
Posts: 53
Rep Power: 17
fcollonv is on a distinguished road
Quote:
Originally Posted by arslantuf View Post
Hi Frédéric,

I have just figured out that after I sent my query. Thank you for explanation. I tried the utility in Of 1.6 with structured mesh . It is working well. But my is different. Flow around the square and trying to get spanwise ( z direction) avarages. The mesh is unstructured in X-Y plane as it is seen in figure. But it is extruded in Z direction so it is structured in Z direction ( layer by layer)

Finally the script is not working in this case. what is your opinion? Is it necessary to modify it? Is it possible to make it run for this kind of mesh?

Thank you

Zakk
Hello Zakk,

Sorry for this amazingly late answer. But actually i don't know why is not working on the unstructured mesh. The main reason for it is that ignores how the interpolation process is down in OpenFOAM neither how the intersection between the plane and the mesh is defined.
I apologize to not be more helpful on this case.

Frederic
fcollonv is offline   Reply With Quote

Old   October 18, 2010, 15:32
Default Performance of the tool
  #28
Member
 
Frederic Collonval
Join Date: Apr 2009
Location: Technische Universitaet Munich - Lehrstuhl fuer Thermodynamik
Posts: 53
Rep Power: 17
fcollonv is on a distinguished road
Quote:
Originally Posted by impecca View Post
Dear Frédéric

Is the reason that you changed 'uniform' to 'midPoint' set because the profile generated from your previous version has some small structure on the profile? (because I always have some small strucutre on profile using your fuction)
If this is the reason, I think this is really good fuction.
I use a lot of your (previous) code, I appreicate your work.

For the latest version of your code, it seems that this fuction averages in all values in homogeneous direction. So it takes quiet a time to average comparing to lats version. (in my case it doesn't work)

So I thinks it is much useful, if there is 'sampledAverageSet' to average at only one line for the big simulation. If you have any plane for making this function, it will be grateful and hopely it can be shared.

Thanks again for your work.

Dear Kim,

The "advantage" of midPoint is that no additional values that the one stored at the centre cell is used to compute the spatial average - hopefully remove some troubles caused by the values on the boundaries.
For the performance of the new version, I would have expected a improvement as no more interpolation is needed. But your case seems to prove the opposite.

To extract only one line, I publish with this post a tool I develop to do it. But it isn't really user friendly. But it could be a starting point.
It could be surely improve as it was one of my first working piece of code for OF

Regards,

Frédéric
Attached Files
File Type: zip ExtractProfile0717.zip (8.9 KB, 43 views)
pyt likes this.
fcollonv is offline   Reply With Quote

Old   October 25, 2010, 05:36
Default
  #29
Member
 
Kim Yusik
Join Date: Dec 2009
Posts: 39
Rep Power: 16
impecca is on a distinguished road
Thanks, FredericI'll check and if there is anything I can improve, then I'll do it and post it.
Thanks again
impecca is offline   Reply With Quote

Old   November 1, 2010, 09:35
Default Error compiling
  #30
Member
 
N. A.
Join Date: May 2010
Posts: 64
Rep Power: 15
N. A. is on a distinguished road
Hello Tufan and others,

I am getting an error compiling a solver in my directory. I was able to compile these solvers earlier before our cluster got crashed. After re-installation of the system, I was able to run the cases, but recetly found that I am not able to comple or recompile the solvers. I get following error for a modified version of coalChemistryFoam (OF 1.6 version). I saw in your post that you also recieved the "ld returned 1 exit status".

-lfiniteVolume -lmeshTools -lcompressibleRASModels -lcompressibleLESModels -llagrangian -llagrangianIntermediate -L/home/NA/OpenFOAM/NA-1.6/lib/linux64GccDPOpt -lmycoalCombustion -lspecie -lbasicThermophysicalModels -lliquids -lliquidMixture -lsolids -lsolidMixture -lthermophysicalFunctions -lreactionThermophysicalModels -lchemistryModel -lradiation -lODE -lOpenFOAM -liberty -ldl -lm -o /home/NA/OpenFOAM/NA-1.6/applications/bin/linux64GccDPOpt/gasificationFoam
/usr/bin/ld: cannot find -liberty
collect2: ld returned 1 exit status


Can you please let me know what did you do in order to over come this error.

If you have anything else in above error that I should try, please let me know.

THanks,
Nir
N. A. is offline   Reply With Quote

Old   November 2, 2010, 02:56
Default liberty
  #31
Senior Member
 
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17
kathrin_kissling is on a distinguished road
Dear Nir,

you are missing a linux package called binutils-dev or similar. You need to install it and then the -liberty problem should be resolved. Maybe it got lost due to the cluster crash.


Best Kathrin
kathrin_kissling is offline   Reply With Quote

Old   July 25, 2012, 07:39
Default sampledAveragePlane
  #32
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 339
Rep Power: 28
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
Hello,

has anyone ported sampledAveragePlane to OF 2.x?

Or has anyone an alternative for calculation the average of a field over one dimension?
GerhardHolzinger is offline   Reply With Quote

Old   July 27, 2012, 05:25
Default sampledAveragePlane for OF 2.0.x
  #33
Member
 
Frederic Collonval
Join Date: Apr 2009
Location: Technische Universitaet Munich - Lehrstuhl fuer Thermodynamik
Posts: 53
Rep Power: 17
fcollonv is on a distinguished road
Hello Gerhard,

Quote:
Originally Posted by GerhardHolzinger View Post
has anyone ported sampledAveragePlane to OF 2.x?
The attached version compiled on 2.0.x but I didn't try it. If you use it please send me a feedback.

Thanks to Gerhard, a bug fix for the version 2.1 was found:

in sampledAveragePlaneTemplates.C, replace the line 62:
Code:
meshSearch searchEngine(mesh(), true);
by
Code:
meshSearch searchEngine(mesh());
Frederic
Attached Files
File Type: gz sampledAveragePlane.tar.gz (9.4 KB, 88 views)
bmikuz likes this.
__________________
Frederic Collonval
Technische Universität München
Thermodynamics Dpt.

Last edited by fcollonv; July 28, 2012 at 05:17. Reason: Bug fix for OF 2.1
fcollonv is offline   Reply With Quote

Old   October 22, 2012, 12:04
Default
  #34
Senior Member
 
Awais Ali
Join Date: Feb 2010
Location: Germany
Posts: 128
Rep Power: 17
owayz is on a distinguished road
Send a message via MSN to owayz
Hallo Friedrich,
I am trying to compile the utility and getting this error. I am using opneFOam 2.1.x on openSuse 11.2.
I would really appreciate if you could help me.
The link below shows the log file from wmake:
https://dl-web.dropbox.com/get/log1?w=44d90c3e
Regards,
Awais
owayz is offline   Reply With Quote

Old   October 22, 2012, 14:12
Default
  #35
Member
 
Frederic Collonval
Join Date: Apr 2009
Location: Technische Universitaet Munich - Lehrstuhl fuer Thermodynamik
Posts: 53
Rep Power: 17
fcollonv is on a distinguished road
Good evening Awais,

The bugfix for version 2.1.x is mentioned on the previous post.
Quote:
in sampledAveragePlaneTemplates.C, replace the line 62:
Code:
meshSearch searchEngine(mesh(), true);
by
Code:
 meshSearch searchEngine(mesh());
Best regards,

Frederic
__________________
Frederic Collonval
Technische Universität München
Thermodynamics Dpt.
fcollonv is offline   Reply With Quote

Old   October 22, 2012, 16:08
Default
  #36
Senior Member
 
Awais Ali
Join Date: Feb 2010
Location: Germany
Posts: 128
Rep Power: 17
owayz is on a distinguished road
Send a message via MSN to owayz
Thanks for your reply Friedrich.
But I have actually changed that and I am getting the error after changing that line.
Regards,
Awais
owayz is offline   Reply With Quote

Old   October 23, 2012, 03:20
Default
  #37
Member
 
Frederic Collonval
Join Date: Apr 2009
Location: Technische Universitaet Munich - Lehrstuhl fuer Thermodynamik
Posts: 53
Rep Power: 17
fcollonv is on a distinguished road
Dear Awais,

I'm sorry but the bug in the log you gave me is clearly the one fixed:

Code:
sampledAveragePlane/sampledAveragePlaneTemplates.C:62: error: no matching function for call to ‘Foam::meshSearch::meshSearch(const Foam::polyMesh&, bool)’
Check that you change the line, run wclean libso and then wmake libso.
If you still have an error, post it.
Some tips to read an compilation error:
Extract the line(s) containing "error" it will help to know which file(s) and line(s) are bringing troubles.
If the error is of type "no matching function for call to", the following lines will provide the valid function interface(s) that will help debugging.

Cheers,

Frederic
bmikuz likes this.
__________________
Frederic Collonval
Technische Universität München
Thermodynamics Dpt.
fcollonv is offline   Reply With Quote

Old   October 23, 2012, 19:18
Default
  #38
Senior Member
 
Awais Ali
Join Date: Feb 2010
Location: Germany
Posts: 128
Rep Power: 17
owayz is on a distinguished road
Send a message via MSN to owayz
Thanks for reply again Fredrich,
I am sure I am doing something else wrong. I will try again and let you know.
Regards,
Awais
owayz is offline   Reply With Quote

Old   October 29, 2012, 10:44
Default
  #39
Senior Member
 
Awais Ali
Join Date: Feb 2010
Location: Germany
Posts: 128
Rep Power: 17
owayz is on a distinguished road
Send a message via MSN to owayz
Hi Again Fredrich,
I am trying to compute average on a plane in z-dir. My case is that of an external flow over a cylinder.
My sampleDict looks like:
Quote:
//From my test the cell scheme is the best in that case
interpolationScheme cell;//cell, cellPoint or cellPointFace

surfaceFormat vtk;//null (no output), vtk, raw or foamFile

surfaces
(
testPlane
{
//type to compute the average
type averagePlane;
//name for the plane - put what you want
name meanPlane;

//Here the plane is defined by a point and the normal to the plane.
basePoint ( 0.1 0.1 0 );
//the normal to the plane HAVE to be parallel to a coordinate axis
normalVector ( 0 0 1 );

//interpolate HAVE to be true else error occurs
interpolate true;
//end of the domain (e.g. here the domain analyzed start from z=0.0 to
//z=0.04 where y is the homogeneous direction)
endOfDomain -0.0502656;
}
);

//list of the analyzed field
fields
(
UMean pMean UPrimeMean pPrimeMean
);
but I am getting this error:
Quote:
Create time

Create mesh for time = 0.6430005

Reading surface description:
meanPlane

Time = 0.6430005
#0 Foam::error:rintStack(Foam::Ostream&) in "/home/linux/tape/aali/data/OF/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigSegv::sigHandler(int) in "/home/linux/tape/aali/data/OF/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 ?? in "/lib64/libc.so.6"
#3 Foam::tmp<Foam::Field<double> > Foam::sampledAveragePlane::interpolateField<double >(Foam::interpolation<double> const&) const in "/home/linux/tape/aali/OpenFOAM/aali-2.1.x/platforms/linux64GccDPOpt/lib/libusrsampling.so"
#4 Foam::sampledAveragePlane::interpolate(Foam::inter polation<double> const&) const in "/home/linux/tape/aali/OpenFOAM/aali-2.1.x/platforms/linux64GccDPOpt/lib/libusrsampling.so"
#5 void Foam::sampledSurfaces::sampleAndWrite<double>(Foam ::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/home/linux/tape/aali/data/OF/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libsampling.so"
#6 void Foam::sampledSurfaces::sampleAndWrite<double>(Foam ::sampledSurfaces::fieldGroup<double>&) in "/home/linux/tape/aali/data/OF/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libsampling.so"
#7 Foam::sampledSurfaces::write() in "/home/linux/tape/aali/data/OF/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libsampling.so"
#8 main in "/home/linux/tape/aali/data/OF/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/bin/sample"
#9 __libc_start_main in "/lib64/libc.so.6"
#10 _start at /usr/src/packages/BUILD/glibc-2.10.1/csu/../sysdeps/x86_64/elf/start.S:116
Segmentation fault
If you have any suggestions?

Regards,
Awais
owayz is offline   Reply With Quote

Old   November 3, 2012, 11:54
Default
  #40
Senior Member
 
Awais Ali
Join Date: Feb 2010
Location: Germany
Posts: 128
Rep Power: 17
owayz is on a distinguished road
Send a message via MSN to owayz
Anybody?
Any information?
owayz is offline   Reply With Quote

Reply


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
Averages in an homogeneous direction luiz OpenFOAM Post-Processing 7 March 12, 2023 09:00
RANS from time average -- How about space average? TT Main CFD Forum 1 April 11, 2006 14:38
ISOTROPIC HOMOGENEOUS TURBULENCE Valdemir Main CFD Forum 2 September 1, 2003 23:04
Complicated Homogeneous Shear DNS ff_fan Main CFD Forum 0 December 9, 2002 18:23
ASM/Homogeneous Patrice Jaumouillie CFX 1 September 17, 2001 04:19


All times are GMT -4. The time now is 03:48.