# [swak4Foam] groovyBC accessing to scalarIOList

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 April 25, 2016, 08:58 [swak4Foam] groovyBC accessing to scalarIOList #1 Senior Member     Tobias Holzmann Join Date: Oct 2010 Location: Leoben (Austria) Posts: 1,548 Blog Entries: 6 Rep Power: 27 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, publications and videos on www.Holzmann-cfd.de OpenFOAM Beginners should check out the new wiki on wiki.openfoam.com A list of some active OpenFOAM contributers can be found »here« A book about the basics of »Mathematics, Numerics, Derivations and OpenFOAM« can be found on www.Holzmann-cfd.de

April 25, 2016, 16:08
#2
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,971
Rep Power: 41
Quote:
 Originally Posted by 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.
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

April 25, 2016, 17:05
#3
Senior Member

Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,548
Blog Entries: 6
Rep Power: 27
Quote:
 Originally Posted by gschaider 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, publications and videos on www.Holzmann-cfd.de
OpenFOAM Beginners should check out the new wiki on wiki.openfoam.com
A list of some active OpenFOAM contributers can be found »here«
A book about the basics of »Mathematics, Numerics, Derivations and OpenFOAM« can be found on www.Holzmann-cfd.de

May 2, 2016, 14:25
#4
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,971
Rep Power: 41
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 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

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post aerogt3 OpenFOAM Post-Processing 4 June 10, 2016 01:46 sagnikmazumdar OpenFOAM Running, Solving & CFD 24 March 1, 2015 08:16 gschaider OpenFOAM 164 January 13, 2015 03:52 liybzd OpenFOAM 1 December 15, 2013 08:08 benk OpenFOAM 3 June 2, 2011 08:49

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

 Contact Us - CFD Online - Top