CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Boundary condition cannot find volScalarField

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ChrisA

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 13, 2014, 14:31
Default Boundary condition cannot find volScalarField
  #1
Member
 
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 14
ChrisA is on a distinguished road
So I've added in non-constant gamma for the totalTemperature boundary condition by having it lookup a value from the solver (exactly the same way other boundary conditions look up say rho). I'm confident this implementation is correct because it's solving fine on my development machine.

However, when I drop the code onto our cluster the boundary condition cannot find Cp.

Code:
    request for volScalarField Cp from objectRegistry region0 failed
    available objects of type volScalarField are
21
(
...
alpha
...
)
Cp simply does not show up in the list. The declaration of Cp is identical to that of alpha (just shown as an example from createFields):

Code:
volScalarField alpha
(
    IOobject
    (
        "alpha",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
    ),
turbulence->alphaEff()
);

volScalarField Cp
(
    IOobject
    (
        "Cp",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::NO_WRITE
    ),
thermo.Cp()
);
I then update Cp at the start of my time loop.

It also does not work if I declare Cp at the start of the time loop:

Code:
    while (runTime.run())
    {
		volScalarField Cp = thermo.Cp();
I'm absolutely stumped as to why this is not working on the cluster but yet solving fine on my test machine. The version of OpenFoam is of course the same and the only difference is the compiler (the cluster uses Intel, whereas the test machine uses the OF native).

That said, there is absolutely no reason it shouldn't be able to find the volScalarField in the first place. Any ideas?
ChrisA is offline   Reply With Quote

Old   March 18, 2014, 18:17
Default
  #2
Member
 
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 14
ChrisA is on a distinguished road
So I got this to work. I think the solution outlines some underlying ignorance of mine with respect to the volScalarField class and the object registry. The way I got it to work was declaring Cp as:

Code:
volScalarField Cp
(
    IOobject
    (
        "Cp",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::NO_WRITE
    ),
mesh,
dimensionedScalar("Cp", dimensionSet(0,2,-2,-1,0), 1)
);
and then update the Cp value at the start of my time loop with Cp = thermo.Cp();

Maybe someone more knowledgeable can explain why the declaration above worked for alpha but not Cp and why this is necessary. If not I'm sure I'll be looking through the class one day and have an AHA moment.

How I managed to get it to run on my test machine is also a magical mystery, maybe someone updated a version somewhere without my knowledge.
LukaD likes this.
ChrisA 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
No-slip condition for non-resolved boundary layer in open channel banks Lupocci Main CFD Forum 1 January 17, 2013 04:11
inlet velocity boundary condition murali CFX 5 August 3, 2012 09:56
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30
Rotating interpolated boundary condition hani OpenFOAM Running, Solving & CFD 0 July 4, 2006 08:09
The Boundary Condition about the Flat Plate boing Main CFD Forum 1 January 6, 2002 17:53


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