CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

[swak4Foam] groovyBC accessing to scalarIOList

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 25, 2016, 08:58
Default [swak4Foam] groovyBC accessing to scalarIOList
  #1
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,397
Blog Entries: 5
Rep Power: 24
Tobi will become famous soon enoughTobi will become famous soon enough
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.
__________________
Best regards,
Tobias Holzmann

Some interesting OpenFOAM tutorials and videos on www.Holzmann-cfd.de
Tobi is online now   Reply With Quote

Old   April 25, 2016, 16:08
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,920
Rep Power: 41
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
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,397
Blog Entries: 5
Rep Power: 24
Tobi will become famous soon enoughTobi will become famous soon enough
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.
__________________
Best regards,
Tobias Holzmann

Some interesting OpenFOAM tutorials and videos on www.Holzmann-cfd.de
Tobi is online now   Reply With Quote

Old   May 2, 2016, 14:25
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,920
Rep Power: 41
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

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] Trouble accessing fields within expressionField aerogt3 OpenFOAM Post-Processing 4 June 10, 2016 01:46
groovyBC issue - k and epsilon sagnikmazumdar OpenFOAM Running, Solving & CFD 24 March 1, 2015 08:16
groovyBC and funkySetFields married and got a kid named swak4Foam gschaider OpenFOAM 164 January 13, 2015 03:52
groovyBC for oscillatory flow liybzd OpenFOAM 1 December 15, 2013 08:08
groovyBC and Eqn.setReference() benk OpenFOAM 3 June 2, 2011 08:49


All times are GMT -4. The time now is 14:05.