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

[swak4Foam] funkySetFields: problem with processor boundary

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 14, 2015, 17:40
Question funkySetFields: problem with processor boundary
  #1
New Member
 
Join Date: May 2015
Location: Russia
Posts: 3
Rep Power: 11
nmikhailov is on a distinguished road
Hi FOAMers!

I use funkySetFields (swakVersion: 0.3.1) for the decomposed case. Internal fields are set remarkably. But I am disturbed by the following problem with processor boundaries. For example, one can consider shockTube case:

for x \in [-5;0) T=348.432, p=1e5, U=0

for x \in [0;5] T=278.746, p=1e4, U=0

Mesh decomposition is done for 4 subdomains:
proc0: [-5;-2.5]
proc1: [-2.5;0]
proc2: [0;2.5]
proc3: [2.5;5]

funkySetFieldsDict contains

expressions
(
leftT
{
field T;
expression "348.432";
condition "pos().x<0";
keepPatches true;
}
rightT
{
field T;
expression "278.746";
condition "pos().x>=0";
keepPatches true;
}
leftP
{
field p;
expression "100000";
condition "pos().x<0";
keepPatches true;
}
rightP
{
field p;
expression "10000";
condition "pos().x>=0";
keepPatches true;
}
);

Run funkySetFields in parallel:
mpirun -np 4 funkySetFields -time 0 -parallel

The execution is successful. There are no warnings and errors.

So, we analyze result now. To start, processor0/0/T:

FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 1 0 0 0];

internalField uniform 348.432;

boundaryField
{
sides
{
type zeroGradient;
}
empty
{
type empty;
}
procBoundary0to1
{
type processor;
value uniform 278.746;
}
}

But T is still 348.432 in subdomain 1...

Similar, processor0/0/P:
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [1 -1 -2 0 0 0 0];

internalField uniform 100000;

boundaryField
{
sides
{
type zeroGradient;
}
empty
{
type empty;
}
procBoundary0to1
{
type processor;
value uniform 10000;
}
}

P.procBoundary0to1 must be 100000.

Further, processor1/0/T:
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 1 0 0 0];

internalField nonuniform List<scalar> 3(348.432 348.432 278.746);

boundaryField
{
sides
{
type zeroGradient;
}
empty
{
type empty;
}
procBoundary1to0
{
type processor;
value uniform 278.746;
}
procBoundary1to2
{
type processor;
value uniform 278.746;
}
}
T.procBoundary1to0 must be 348.432.

I hope, the problem is explained.

Does somebody know how to solve this problem ?
nmikhailov is offline   Reply With Quote

Old   May 25, 2015, 18:33
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 nmikhailov View Post
Hi FOAMers!

I use funkySetFields (swakVersion: 0.3.1) for the decomposed case. Internal fields are set remarkably. But I am disturbed by the following problem with processor boundaries. For example, one can consider shockTube case:

for x \in [-5;0) T=348.432, p=1e5, U=0

for x \in [0;5] T=278.746, p=1e4, U=0

Mesh decomposition is done for 4 subdomains:
proc0: [-5;-2.5]
proc1: [-2.5;0]
proc2: [0;2.5]
proc3: [2.5;5]

funkySetFieldsDict contains

expressions
(
leftT
{
field T;
expression "348.432";
condition "pos().x<0";
keepPatches true;
}
rightT
{
field T;
expression "278.746";
condition "pos().x>=0";
keepPatches true;
}
leftP
{
field p;
expression "100000";
condition "pos().x<0";
keepPatches true;
}
rightP
{
field p;
expression "10000";
condition "pos().x>=0";
keepPatches true;
}
);

Run funkySetFields in parallel:
mpirun -np 4 funkySetFields -time 0 -parallel

The execution is successful. There are no warnings and errors.

So, we analyze result now. To start, processor0/0/T:

FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 1 0 0 0];

internalField uniform 348.432;

boundaryField
{
sides
{
type zeroGradient;
}
empty
{
type empty;
}
procBoundary0to1
{
type processor;
value uniform 278.746;
}
}

But T is still 348.432 in subdomain 1...

Similar, processor0/0/P:
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [1 -1 -2 0 0 0 0];

internalField uniform 100000;

boundaryField
{
sides
{
type zeroGradient;
}
empty
{
type empty;
}
procBoundary0to1
{
type processor;
value uniform 10000;
}
}

P.procBoundary0to1 must be 100000.

Further, processor1/0/T:
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 1 0 0 0];

internalField nonuniform List<scalar> 3(348.432 348.432 278.746);

boundaryField
{
sides
{
type zeroGradient;
}
empty
{
type empty;
}
procBoundary1to0
{
type processor;
value uniform 278.746;
}
procBoundary1to2
{
type processor;
value uniform 278.746;
}
}
T.procBoundary1to0 must be 348.432.

I hope, the problem is explained.

Does somebody know how to solve this problem ?
Hm. The problem seems to be that after manipulating the internalField correctBoundaryConditions has to be called to propagate it to the the other processors. Seems that funkySetFields doesn't do that. Seems that this is as well a bug (in your case) as a feature (as this might make it fail if a boundary condition needs other fields and these fields are not there)
__________________
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   May 25, 2015, 22:17
Default
  #3
New Member
 
Join Date: May 2015
Location: Russia
Posts: 3
Rep Power: 11
nmikhailov is on a distinguished road
Thank you for the advice Bernhard!
At the moment I have added calls correctBoundaryConditions for required fields in "createFields" of the solver I am using. I have maked the comparison of solutions for two variants:
1. ...-> funkySetFields -> decomposePar->...
and
2. ..-> decomposePar -> funkySetFields ->...
Solutions are equal now!
nmikhailov is offline   Reply With Quote

Old   May 26, 2015, 10:13
Default
  #4
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 nmikhailov View Post
Thank you for the advice Bernhard!
At the moment I have added calls correctBoundaryConditions for required fields in "createFields" of the solver I am using. I have maked the comparison of solutions for two variants:
1. ...-> funkySetFields -> decomposePar->...
and
2. ..-> decomposePar -> funkySetFields ->...
Solutions are equal now!
OK. I'll add an option to do that to FSF. But I won't do it automatically for the reasons given above
__________________
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   May 26, 2015, 10:48
Default
  #5
New Member
 
Join Date: May 2015
Location: Russia
Posts: 3
Rep Power: 11
nmikhailov is on a distinguished road
Quote:
Originally Posted by gschaider View Post
OK. I'll add an option to do that to FSF. But I won't do it automatically for the reasons given above
It's a good idea! Thank you Bernhard!
nmikhailov is offline   Reply With Quote

Reply

Tags
funkysetfields, problem, processor boundary


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
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 05:43
[swak4Foam] Problem with compiling funkySetFields Victor OpenFOAM Community Contributions 4 July 19, 2011 17:34
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 06:59
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 07:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 20:13


All times are GMT -4. The time now is 13:53.