|
[Sponsors] |
An error about "const volVectorField& U = db().lookupObject<volVectorField>("U");" |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 2, 2014, 03:40 |
An error about "const volVectorField& U = db().lookupObject<volVectorField>("U");"
|
#1 |
New Member
Zhiyuan Li
Join Date: Aug 2013
Location: Beijing
Posts: 9
Rep Power: 13 |
Hello everyone,
I'm try to write a new pressure BC in OpenFoam.In this BC, I need to use velocity. So I use the code "const volVectorField& U = db().lookupObject<volVectorField>("U");" to get the information of U into the BC. The BC has been compiled successfully. but when I use it in a case, the solver show an error below: -------------------------------------------------------------------- Reading field p --> FOAM FATAL ERROR: request for volVectorField U from objectRegistry region0 failed available objects of type volVectorField are 0 ( ) From function objectRegistry::lookupObject<Type>(const word&) const in file /home/lizhy1/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 164. FOAM aborting ---------------------------------------------------------------------- I don't know how to solve this problem. Please Help me! Any help will be appreciated. |
|
December 3, 2014, 04:25 |
|
#2 |
Member
Thomas Vossel
Join Date: Aug 2013
Location: Germany
Posts: 45
Rep Power: 13 |
While I cannot help as I'm introducing myself into writing BCs too I'd like to extend the question. When looking at OpenFoam's code one can find segments like this:
Code:
const fvPatchScalarField& kp = patch().lookupPatchField<volScalarField, scalar>(kName_); Code:
//- Name of the turbulent kinetic energy field word word kName_; Code:
kName_(dict.lookupOrDefault<word>("k", "k")) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
const volVectorField& U = db().lookupObject<volVectorField>("U") gives runtime error | kumar2 | OpenFOAM Programming & Development | 6 | March 9, 2020 01:01 |