CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] problems using "accumulations (weightedAverage)" in parallel

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 8, 2014, 05:57
Default problems using "accumulations (weightedAverage)" in parallel
  #1
New Member
 
Sam Fredriksson
Join Date: Dec 2010
Posts: 20
Rep Power: 15
safre is on a distinguished road
I have started to use swak4foam which seems to be a very interesting and powerful tool. I have though some problems as below.

I would like to use swak4foam to monitor RMS and mean for U and T during runtime. I have managed to do that in serial but get into trouble when doing it in parallel.

As an example in my controlDict:

libs (
"libOpenFOAM.so"
"libsimpleSwakFunctionObjects.so"
);

functions
{
TMean
{
type swakExpression;
valueType surface;
surfaceName monitoringSurface1;
surface {
type plane;
basePoint (0 0 0.1023);
normalVector (0 0 1);
interpolate false;
}
functionObjectLibs ("libsampling.so");
outputControlMode timestep;
outputInterval 1;

zoneName monitoringZone1;
accumulations (weightedAverage);
expression "T";
verbose true;
}
}


[1] --> FOAM FATAL ERROR:
[1] Can not construct weight field of the expected size. For sizes on the processors see above
[1]
[1]
[1] From function SampledSurfaceValueExpressionDriver::weightsNonPoi nt
[1] in file SampledSurfaceValueExpressionDriver.C at line 316.

Is this a general problem or something I have done wrong in my setup of the case?

I then tried to use the "sum" function which would work (although not ideal) in this specific situation since all my cells are of the same size. It worked in parallel but then I get the twize the actual result - is this expected?

libs (
"libOpenFOAM.so"
"libsimpleSwakFunctionObjects.so"
);

functions
{
TSum
{
type swakExpression;
valueType surface;
surfaceName monitoringSurface1;
surface {
type plane;
basePoint (0 0 0.1023);
normalVector (0 0 1);
interpolate false;
}
functionObjectLibs ("libsampling.so");
outputControlMode timestep;
outputInterval 1;

zoneName monitoringZone1;
accumulations (sum);
expression "T";
verbose true;
}
}

Regards, Sam
safre is offline   Reply With Quote

Old   January 8, 2014, 09:36
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by safre View Post
I have started to use swak4foam which seems to be a very interesting and powerful tool. I have though some problems as below.

I would like to use swak4foam to monitor RMS and mean for U and T during runtime. I have managed to do that in serial but get into trouble when doing it in parallel.

As an example in my controlDict:

libs (
"libOpenFOAM.so"
"libsimpleSwakFunctionObjects.so"
);

functions
{
TMean
{
type swakExpression;
valueType surface;
surfaceName monitoringSurface1;
surface {
type plane;
basePoint (0 0 0.1023);
normalVector (0 0 1);
interpolate false;
}
functionObjectLibs ("libsampling.so");
outputControlMode timestep;
outputInterval 1;

zoneName monitoringZone1;
accumulations (weightedAverage);
expression "T";
verbose true;
}
}


[1] --> FOAM FATAL ERROR:
[1] Can not construct weight field of the expected size. For sizes on the processors see above
[1]
[1]
[1] From function SampledSurfaceValueExpressionDriver::weightsNonPoi nt
[1] in file SampledSurfaceValueExpressionDriver.C at line 316.

Is this a general problem or something I have done wrong in my setup of the case?

I then tried to use the "sum" function which would work (although not ideal) in this specific situation since all my cells are of the same size. It worked in parallel but then I get the twize the actual result - is this expected?

libs (
"libOpenFOAM.so"
"libsimpleSwakFunctionObjects.so"
);

functions
{
TSum
{
type swakExpression;
valueType surface;
surfaceName monitoringSurface1;
surface {
type plane;
basePoint (0 0 0.1023);
normalVector (0 0 1);
interpolate false;
}
functionObjectLibs ("libsampling.so");
outputControlMode timestep;
outputInterval 1;

zoneName monitoringZone1;
accumulations (sum);
expression "T";
verbose true;
}
}

Regards, Sam
Which version of swak are you using? Latest released on or the development version from the repository. I vaguely remember fixing something with the weight-function. But not necessarily this problem

No. 2times the actual result shouldn't happen. You've got 2 CPUs and get EXACTLY 2 times the result (äh. Have you tried 3 CPUs?)

In both cases I'd be interested in simple example cases to reproduce the problem
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   January 8, 2014, 10:09
Default
  #3
New Member
 
Sam Fredriksson
Join Date: Dec 2010
Posts: 20
Rep Power: 15
safre is on a distinguished road
Thanks for your fast reply

I checked out the swak4foam version as

svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_2.0/libraries/swak4Foam/ swak4Foam_2.x

and the problem is running under


openfoam/2.1.x-20120306

I do not think the 2 multiplyer has something to do with the number of CPU (could it be something with calculating both side of the face). I have now tried with both 16 and 32 wtih the same result.

Since the case I am running is with a solver I have developed from one of the standard solvers I will try to make a simpler case with a standard solver and see if my problems persist.

Regards, Sam
safre is offline   Reply With Quote

Old   January 8, 2014, 11:09
Default
  #4
New Member
 
Sam Fredriksson
Join Date: Dec 2010
Posts: 20
Rep Power: 15
safre is on a distinguished road
I have now used the tutorial channel395 and changed the

system/controlDict as:

...
libs (
"libOpenFOAM.so"
"libsimpleSwakFunctionObjects.so"
);

functions
{
fieldAverage1
{
type fieldAverage;
functionObjectLibs ( "libfieldFunctionObjects.so" );
enabled true;
outputControl outputTime;

fields
(
U
{
mean on;
prime2Mean on;
base time;
}

p
{
mean on;
prime2Mean on;
base time;
}
);
}

UMean
{
type swakExpression;
valueType surface;
surfaceName monitoringSurface1;
surface {
type plane;
basePoint (2.1 0 0);
normalVector (1 0 0);
interpolate false;
}
functionObjectLibs ("libsampling.so");
outputControlMode timestep;
outputInterval 1;

// zoneName monitoringZone1;
accumulations (weightedAverage);
expression "U";
verbose true;
}

UMean_SUM
{
type swakExpression;
valueType surface;
surfaceName monitoringSurface1;
surface {
type plane;
basePoint (2.1 0 0);
normalVector (1 0 0);
interpolate false;
}
functionObjectLibs ("libsampling.so");
outputControlMode timestep;
outputInterval 1;

// zoneName monitoringZone1;
accumulations (sum);
expression "U";
verbose true;
}
}

// ************************************************** *********************** //

and constant/polyMesh/blockMeshDict (to make it easier to compare the values) as:

...
blocks
(
hex (0 1 3 2 6 7 9 8) (40 25 30) simpleGrading (1 1 1)
hex (2 3 5 4 8 9 11 10) (40 25 30) simpleGrading (1 1 1)
);
...

and ran it both in serial and parallel (4 cpus) and get the same kind of problems.

Regards, Sam
safre is offline   Reply With Quote

Old   January 8, 2014, 13:42
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by safre View Post
Thanks for your fast reply

I checked out the swak4foam version as

svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_2.0/libraries/swak4Foam/ swak4Foam_2.x

and the problem is running under


openfoam/2.1.x-20120306

I do not think the 2 multiplyer has something to do with the number of CPU (could it be something with calculating both side of the face). I have now tried with both 16 and 32 wtih the same result.

Since the case I am running is with a solver I have developed from one of the standard solvers I will try to make a simpler case with a standard solver and see if my problems persist.

Regards, Sam
I don't have time to look at it during the next few days and after some days I usually forget these things. Please open a bug at
http://sourceforge.net/apps/mantisbt...l_bug_page.php
to make sure that it will get looked at. Thanks

PS: the version you're using is the last release. The public development version (the mercurial-repository) might or might not have already a fix for this
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   January 9, 2014, 03:53
Default
  #6
New Member
 
Sam Fredriksson
Join Date: Dec 2010
Posts: 20
Rep Power: 15
safre is on a distinguished road
Ok

https://sourceforge.net/apps/mantisb...iew.php?id=196

//Sam
safre 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
[OpenFOAM.com] problems running in parallel on Mac OS X and Windows: only 1 cpu windscion OpenFOAM Installation 20 June 5, 2020 17:27
directMapped + regionCoupling + parallel problems elisabet OpenFOAM Running, Solving & CFD 15 October 3, 2018 11:04
[OpenFOAM.org] Problems with using MPIRUN/run cases in parallel in OpenFOAM 4.1 Proportion OpenFOAM Installation 1 August 25, 2017 14:43
MPI parallel meet problems jiaojiao OpenFOAM 1 May 10, 2016 03:30
Problems with "polyTopoChange" on parallel?!? daZigeiner OpenFOAM Programming & Development 0 March 14, 2011 11:05


All times are GMT -4. The time now is 08:28.