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

Errors when using pimpleFoam with a New BC

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 13, 2021, 23:33
Default Errors when using pimpleFoam with a New BC
  #1
New Member
 
Zhang Qibo
Join Date: Oct 2021
Posts: 7
Rep Power: 4
Gareth_CN is on a distinguished road
Hello,

I am newbie to OpenFOAM. I am using OpenFOAM v8.

I would like to code a new BC which couples `timeVaryingMappedFixedValue` BC and `inletOutlet` BC. After interpolating the values from a set of supplied points in space and time, the typs of BC ('into of domain' or 'out of domain' ) would be determined by the sign of the flus across patch faces.

- Positive flux (out of domain): apply zero-gradient condition
- Negative flux (into of domain): apply the interpolation values as fixed-value

The new BC, named 'timeVaryingInletOutlet' can be well compiled. But I get the error message as belows when I run "decomposePar" on a test case based on pimpleFoam:

Code:
--> FOAM FATAL ERROR:
    request for surfaceScalarField phi from objectRegistry region0 failed
    available objects of type surfaceScalarField are 0()

    From function const Type& Foam::objectRegistry::lookupObject(const Foam::word&) const [with Type = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>] in file /home/gareth/OpenFOAM/OpenFOAM-8/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 211.
It seems that the flux `phi ` of type surfaceScalarField cannot not be found. I have examined the source file `createFields.H` which contains the call to `createPhi.H` (I did not modify this file).

I have searched for relevant problems on this forum, but I have not found a solution to my case.

Here is the `updateCoeffs` function of myCode, which is related to flux:

Code:
template<class Type>
void Foam::timeVaryingInletOutletFvPatchField<Type>::updateCoeffs()
{
    if (this->updated())
    {
        return;
    }
   this->operator==(fieldMapper_.map());
// copied from the source file of  'inletOutlet' boundary
    const Field<scalar>& phip =
        this->patch().template lookupPatchField<surfaceScalarField, scalar>
        (
            phiName_
        );
    this->valueFraction() = 1.0 - pos0(phip);
//
    fixedValueFvPatchField<Type>::updateCoeffs();
}
Line 211 of `objectRegistryTemplates.C`:

Code:
        FatalErrorInFunction
            << nl
            << "    request for " << Type::typeName
            << " " << name << " from objectRegistry " << this->name()
            << " failed\n    available objects of type " << Type::typeName
            << " are" << nl
            << names<Type>();

        if (cacheTemporaryObject(name))
        {
            FatalErrorInFunction
                << nl
                << "    request for " << name << " from objectRegistry "
                << this->name() << " to be cached failed" << nl
                << "    available temporary objects are" << nl
                << temporaryObjects_;
        }
        FatalErrorInFunction                 // line 211
            << abort(FatalError);            // line 212
    }
    return NullObjectRef<Type>();
Maybe I made some stupid mistake. Hope someone could give me some advice!

All regards!

Gareth
Gareth_CN 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
Building OpenFOAM1.7.0 from source ata OpenFOAM Installation 46 March 6, 2022 13:21
pimpleDyMFoam computation randomly stops babapeti OpenFOAM Running, Solving & CFD 5 January 24, 2018 05:28
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 04:03
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 18:07


All times are GMT -4. The time now is 16:49.