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

[swak4Foam] Field reference in parallel with groovyBC

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 10, 2019, 10:54
Default Field reference in parallel with groovyBC
  #1
New Member
 
Magnus Johannesen
Join Date: Oct 2018
Posts: 3
Rep Power: 7
magjo is on a distinguished road
Good day foamers!

I have a problem with groovyBC when referencing field values in parallel. I'm running openfoam 6 with swak4foam developer version, and the case has been tested on both linux and mac with docker giving the same results.

The domain is reconstructed blood vessels, and has one inlet and several outlets. For the outlets I'm using a resistance analogy for outflow bounadry condition U = \frac{2*p}{R*A_{outlet_i}}, and relating the outlet flow to the pressure and resistance in the blood vessels.

The setting of groovyBC in U is as follows:

Code:
 
    outlet1 //outlet 1 surface4
    {
      type            groovyBC;
      valueExpression "(p/resistance*2/(pi*pow(radius,2))*(1-sphere/pow(radius,2)))*normal()";
      variables
8
(
"frac=0.255235606748;"
"Q=1e-6;"
"xc=0.5*(min(pts().x)+max(pts().x));"
"yc=0.5*(min(pts().y)+max(pts().y));"
"zc=0.5*(min(pts().z)+max(pts().z));"
"radius=sqrt(sum(mag(Sf()))/pi);"
"sphere=(pow((pos().y-yc),2)+pow((pos().x-xc),2)+pow((pos().z-zc),2));"
"resistance=46751015.7676;"
)
;
}
This continues for 6 more outlets. The only difference from each outlet is that the resistance is changing. When running the case in serial everything works fine. When running it in paralllel the simulation starts exploding after about 100 iterations. The sphere part is to induce a parabolic flow profile, and gave no difference when excluding this part and just using pressure and resistance.

I found this note on the contrib/swak4Foam site:
Code:
9.6.3 Bugfixes
9.6.3.1 Variables not working for parallel computations
    If a variable is defined and the patch which it is defined on
    doesn't have any faces the variable is reported on that processor
    as not existing and the whole run fails
But it is not the variables that are undefined, if that had been the case, the resistance part would have been divided by zero and it would have exploded in iteration 1 and not 100. I also tried it without variables but the same thing happens then as well.

Code:
    outlet1 //outlet 1 surface4
    {
      type            groovyBC;
      valueExpression "(average(p)/17028966.9573*2/sum(mag(Sf()))*(1-(pow((pos().y-0.5*(min(pts().y)+max(pts().y))),2)+pow((pos().x-0.5*(min(pts().x)+max(pts().x))),2)+pow((pos().z-0.5*(min(pts().z)+max(pts().z))),2))/(sum(mag(Sf()))/pi)))*normal()";
}

I haven't found any recent issues of this problem, so I sincerely hope that someone knows how it is possible to fix it.
magjo is offline   Reply With Quote

Old   February 25, 2020, 06:00
Default
  #2
New Member
 
Adriana Ferreira
Join Date: Sep 2018
Posts: 6
Rep Power: 7
Adriana Correia is on a distinguished road
Hi Magnus,


I'm facing the same problem by using groovyBC in parallel. In my case, I need to access x position. Everything works well in serie, but then in parallel it blows up at the first iteration.


Did you find a solution for your case ?


Thank you and Best regards,
Adriana
Adriana Correia is offline   Reply With Quote

Old   March 4, 2020, 14:18
Default
  #3
New Member
 
Magnus Johannesen
Join Date: Oct 2018
Posts: 3
Rep Power: 7
magjo is on a distinguished road
Hi! I did not find a solution. There seems to have been a bug on the bug tracker previously:
https://sourceforge.net/p/openfoam-e...swak4foam/123/

This bug was related to a specific version, and not followed after 2014. You can also look at the thread which lead up to it, maybe it has some ideas that might help.

Bug in groovyBC in parallel computation

Unfortunately it seems that little has happened since 2014.
magjo is offline   Reply With Quote

Reply

Tags
groovybc, parallel, swak4foam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
LEMOS InflowGenerator r_gordon OpenFOAM Running, Solving & CFD 103 December 18, 2018 00:58
''unknown radialModelType type Gidaspow'' PROBLEM WITH THE BED TUTORIAL AndoniBM OpenFOAM Running, Solving & CFD 2 March 25, 2015 18:44
problem with turbulence models after compilation? lfgmarc OpenFOAM Programming & Development 19 November 20, 2013 00:50
OpenFOAM 1.6 ext - Compilation errors - Fedora 17(32bit) toolpost OpenFOAM Installation 15 September 21, 2012 09:38
Constant velocity of the material Sas CFX 15 July 13, 2010 08:56


All times are GMT -4. The time now is 22:02.