groovyBC controlled by scalar
Hi all,
could somebody help me? I'm trying to implement thermostat function in OpenFOAM. I'm using groovyBC. I want something like this (in the 0/T file): Code:
hotWall If I declare Burner as volScalarField in the solver and change the value on the corresponding patch (hotWall), it works fine. But this is quite complicated and IMHO nasty way how to do it. So my question is: Is there any way how to achieve this using variable Burner only as a scalar? I tried this (and many other variation): Code:
dimensionedScalar Burner Do you have any idea how to use only scalar in the groovyBC? Thank very much for your help regards Jaroslav |
Quote:
You'll have to make the place were global variables are stored known to the solver with Code:
#include "GlobalVariablesRepository.C" Code:
GlobalVariablesRepository::getGlobalVariables().addValue( Now in the boundary condition you've got to make the global scope known with Code:
globalScopes ( BurnerControl ); If you want to keep your solver "swak-free" then an alternative would be to implement the burner algorithm in a functionObject and set the global variable there. This is possible with the swakCoded-functionObject (which basically is the usual coded-FO with the possibility to set globals) or the pythonIntegration-functionObject. |
Hi Bernhard,
thank you very much for your help! It works. My monster code is alive! ;) (thunder in background :) ) Jaroslav |
Quote:
|
Quote:
|
Quote:
Currently the constructor only supports dimensioned values. But as you see above (dimless) this is no problem. The constructor is templated to accept any dimensioned-thing, but the internals (ugly, but serves its purpose) of ExpressionResult only accept scalar, vector, tensor, symmTensor and sphericalThensor |
Hi Bernhard,
I followed the steps as shown. I added the libraries and the paths correctly. I also added the "include" file at the top of .C file before main(). Now if I add GlobalVariablesRepository::getGlobalVariables().ad dValue( "Burner", "BurnerControl", ExpressionResult(dimensionedScalar("burner",dimles s,burner)) ); to the createFields, I get the 'No matching function for call to 'Foam::GlobalVariableRepository'' error. Could you please let me know where do I make the function call? |
All times are GMT -4. The time now is 11:54. |