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, 11:54
Default Field reference in parallel with groovyBC
  #1
New Member
 
Magnus Johannesen
Join Date: Oct 2018
Posts: 1
Rep Power: 0
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

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


All times are GMT -4. The time now is 16:45.