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

[swak4Foam] groovyBC accessing to scalarIOList

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 25, 2016, 08:58
Default groovyBC accessing to scalarIOList
  #1
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hey all & Bernhard,

just a simple question. Is there the possibility to access scalarIOList within groovyBC? The problem on that I focus at the moment is, that I created a Gaussian-Temperature Boundary-Condition (LASER) using groovyBC and now I want to reduce the used power by a coefficient. The coefficient is calculated in my solver and needs to be available in the boundary. The only work-around that solved my problem till now is to create a new volScalarField that includes the value of the coefficient. This works but finally its not a good solution. The other way would be to calculate the coefficient within the BC but therefore I need some other fields.

Any suggestion is welcomed.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   April 25, 2016, 16:08
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 Tobi View Post
Hey all & Bernhard,

just a simple question. Is there the possibility to access scalarIOList within groovyBC? The problem on that I focus at the moment is, that I created a Gaussian-Temperature Boundary-Condition (LASER) using groovyBC and now I want to reduce the used power by a coefficient. The coefficient is calculated in my solver and needs to be available in the boundary. The only work-around that solved my problem till now is to create a new volScalarField that includes the value of the coefficient. This works but finally its not a good solution. The other way would be to calculate the coefficient within the BC but therefore I need some other fields.

Any suggestion is welcomed.
Accesing stuff that is not registered with the mesh (in other words: a child-class of registeredIOObject) is almost impossible if the two implementations (BC and solver) don't share code.

What is not totally clear to me: is the coefficient one scalar for the whole simulation or one scalar value per patch face? And it is calculated in the code of your solver?

If it is just one value it should be possible to use the global-variables in swak4Foam (usually through the calculateGlobalVariables-function plugin). It should be even possible to inject such global variables from the solver. But the API of the GlobalVariablesRepository is not designed for this and of course it binds the code of your solver to swak4Foam
__________________
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   April 25, 2016, 17:05
Default
  #3
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by gschaider View Post
Accesing stuff that is not registered with the mesh (in other words: a child-class of registeredIOObject) is almost impossible if the two implementations (BC and solver) don't share code.

What is not totally clear to me: is the coefficient one scalar for the whole simulation or one scalar value per patch face? And it is calculated in the code of your solver?

If it is just one value it should be possible to use the global-variables in swak4Foam (usually through the calculateGlobalVariables-function plugin). It should be even possible to inject such global variables from the solver. But the API of the GlobalVariablesRepository is not designed for this and of course it binds the code of your solver to swak4Foam
Hi Bernhard,

the missing information (or not clear information):

  • the scalar is only one value
  • it is calculated in the solver
At the moment I am using a volScalarField that is working nice but I do not know how the speed is influenced using very big meshes. In the groovyBC I just check out the max value (finally each value in the volScalarField is identically):
Code:

type groovy;
{
   .
   .
   variables
   (
         "myScalar=max(powerCoeff)";
   );
}
I was only interested if you already had some work-around. Maybe I will check it out with swak4Foam. If it is binded, does not matter.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   May 2, 2016, 14:25
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
Sorry. But there is currently no easy fix for your problem. One reason is that there is no general mechanism like the objectRegistry for scalar data

Quote:
Originally Posted by Tobi View Post
Hi Bernhard,

the missing information (or not clear information):

  • the scalar is only one value
  • it is calculated in the solver
At the moment I am using a volScalarField that is working nice but I do not know how the speed is influenced using very big meshes. In the groovyBC I just check out the max value (finally each value in the volScalarField is identically):
Code:

type groovy;
{
   .
   .
   variables
   (
         "myScalar=max(powerCoeff)";
   );
}
I was only interested if you already had some work-around. Maybe I will check it out with swak4Foam. If it is binded, does not matter.
__________________
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

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
[swak4Foam] groovyBC for oscillatory flow liybzd OpenFOAM Community Contributions 5 November 12, 2018 07:53
[swak4Foam] reactingMultiPhaseEulerFoam problems with groovyBC zanilu70 OpenFOAM Community Contributions 4 December 13, 2016 06:46
[swak4Foam] Change in alpha and U with groovyBC in twoPhaseEulerFoam dani2702 OpenFOAM Community Contributions 0 November 17, 2016 03:30
[swak4Foam] groovyBC issue - k and epsilon sagnikmazumdar OpenFOAM Community Contributions 24 March 1, 2015 07:16
[swak4Foam] groovyBC and Eqn.setReference() benk OpenFOAM Community Contributions 3 June 2, 2011 08:49


All times are GMT -4. The time now is 17:04.