View Issue Details

IDProjectCategoryView StatusLast Update
0000535OpenFOAMBugpublic2013-06-12 05:16
Reporteruser256Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformPCOSLinux Red-HatOS Versionversion 2.6.18-2
Summary0000535: pressureGradientExplicitSource does not work in OF 2.1
Description    
I tried to add a pressure gradient to a flow using the new feature fieldSources, such that I don't have to explicitely add it to the solver anymore. A run time error is reased:


--> FOAM FATAL ERROR:

    request for volScalarField (1|A(U)) from objectRegistry region0 failed
    available objects of type volScalarField are

5
(
nut
k
nu
p
epsilon
)
Steps To ReproduceFollowing the description in the .H file, I have added the following to the sourceProperties dictionary:

presGradient
{
    type pressureGradientExplicitSource;
    active on; //on/off switch
    timeStart 0.0; //start time
    duration 1e10; //duration
    selectionMode all; //cellSet // points //cellZone

    pressureGradientExplicitSourceCoeffs
    {
         UName U;
         fieldNames (U);
         Ubar (10 0 0 ); // set Re=64,000
         flowDir (1.0 0 0 ); // set Re=64,000
         gradPini gradPini [0 2 -2 0 0] 0; // initial pressure gradient
    }
}

FieldNames is actually not in the .H description, however, without it is complaining about a missing key word.

An example case based on TJunction is added which reases the error. I run it with pimpleFoam
Additional InformationAdded and example case which I run with pimpleFoam to produce the error.
TagsNo tags attached.

Activities

user256

2012-05-15 07:58

 

TJunctionSources.tgz (3,283 bytes)

henry

2012-05-15 09:48

manager   ~0001315

In OpenFOAM-2.1.? the (1|A(U)) is cached in UEqn.H for use in the sources:

volScalarField rAU(1.0/UEqn().A());

if (pimple.momentumPredictor())
{
    solve(UEqn() == -fvc::grad(p) + sources(U));
}

Could you check that the solver you are running includes the line

volScalarField rAU(1.0/UEqn().A());

user256

2012-05-15 10:56

  ~0001316

Problem solved: I was using the 2.1.0 version. In this version of pimpleFoam, the sources(U) term is added in the definition of UEqn matrix, which is -before- the declaration of rAU, hence rAU is not found in the library. In the 2.1.x version the sources(U) term is moved to line where solve is called; after the declaration of rAU. So 2.1.x already gives the bug fix.
By the way, in my example of the sourceProperties I uploaded I had the wrong dimensions for gradP, but that is easily fixed. Thanks for the quick responds.
Eelco

Issue History

Date Modified Username Field Change
2012-05-15 07:58 user256 New Issue
2012-05-15 07:58 user256 File Added: TJunctionSources.tgz
2012-05-15 09:48 henry Note Added: 0001315
2012-05-15 10:56 user256 Note Added: 0001316
2012-05-15 11:12 henry Status new => resolved
2012-05-15 11:12 henry Resolution open => fixed
2012-05-15 11:12 henry Assigned To => henry