CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Object registry empty (https://www.cfd-online.com/Forums/openfoam-programming-development/125878-object-registry-empty.html)

AlmostSurelyRob November 2, 2013 13:35

Object registry empty
 
Dear All,

I am developing a little library for translation frames. The idea is that the equations are solved in a moving, possibly accelerating frame of refence but the velocity can be changed in different ways. The library allows to switch between different translation models. It contains appropriate boundary conditions and several different velocity change methods (including constant),

I am now implementing tracking with respect to a centre of volume of a selected scalar. This is in order to cover cases similar to the one in Rusche's thesis.

The initalisation of the constructor of the respective class looks like this:

Code:

  centreOfVolumeTranslation::centreOfVolumeTranslation(
      const Time& runTime,
      const fvMesh& mesh,
      const dictionary& TFRDict,
      const word& translationName)
    :
      translationalFrame(runTime, mesh, TFRDict),
      alpha1_(runTime.db().lookupObject<volScalarField>("alpha1")),
...

alpha1_ is declared as const reference in the class body. alpha1 is already defined in the solver (a slight modification of interFoam). However, when I run the code I get

Code:

 
request for volScalarField alpha1 from objectRegistry bubble failed
    available objects of type volScalarField are

0
(
)

So I am a little confused. Not only alpha1 isn't found but no fields are found at all. How is this supposed to work?

I wouldn't like to change the interface to my library as providing alpha1 to the constructor is redunant in my case - most models don't use it. The read access to alpha1 field is enough and I understand that object registry should allow for this. Please let me know if you have any suggestions.


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