View Issue Details

IDProjectCategoryView StatusLast Update
0001717OpenFOAMBugpublic2015-05-29 08:49
Reporteruser1152Assigned Tohenry  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSSuSeOS Version11
Summary0001717: MPPICFoam/DPMFoam's contiuousPhaseName is not compatable with all BC.
DescriptionFirst bug (crash):
When using the lagrangian solver MPPICFoam (or DPMFoam), it is possible to specify a "contiuousPhaseName" in "constant/transportProperties". This will alter the name of the fields. For example, if "contiuousPhaseName=air;", then the density is called rho.air, phi is called phi.air, and so on.

However, some BC do not support any other name than "phi" for phi: It is a hard-coded name. E.g., in src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C:
    const surfaceScalarField& phi = db().lookupObject<surfaceScalarField>("phi");
Whereas some BC do support this functionality, e.g. in src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C:
    const surfaceScalarField& phi =
      this->db().objectRegistry::template lookupObject<surfaceScalarField>
      (phiName_);

Which results in the obvious error:
"
--> FOAM FATAL ERROR:

    request for surfaceScalarField phi from objectRegistry region0 failed
    available objects of type surfaceScalarField are

9
(
...
phi.air
...
)
"

--------------------------------------------------
Second bug (typo):
In "constant/transportProperties" the keyword is spelled "contiuousPhaseName", instead of "continuousPhaseName".
Steps To ReproduceTake the attached case and execute it with:
$ blockMesh
$ MPPICFoam



More generally, any BC that pops up with the following command will result in the same fatal error:
$ grep -rnw $FOAM_SRC/finiteVolume/ -e 'lookupObject<.*>("phi")'
(Which only finds those BC which do not use multiple lines for the search query, of course.)
Additional InformationNote 1)
The problem is resolved by setting "contiuousPhaseName" to an empty string (which effectively removes the feature) in "constant/transportProperties", like such: "contiuousPhaseName ;".

Note 2)
In the tutorial case of MPPICFoam "tutorials/lagrangian/MPPICFoam/injectionChannel/" this does not occur, since those BC happen not to use phi in the first place.
There are, however, lines "phi phi.air;" in the 0/p dictionary. These lines are meaningless: comment them and nothing changes, as those BC never read those dictionary items.
That line in 0/U.air is however used, since the BC "inletOutlet" does support a different name for phi.
TagsNo tags attached.

Activities

user1152

2015-05-28 16:05

 

MPPICFoam_bugCase.tar (61,440 bytes)

henry

2015-05-28 17:04

manager   ~0004830

Second bug is resolved by
commit 139084f451dc471d3af82e62a73196bfa81a66dc in OpenFOAM-2.4.x
commit e8c7aac911d7130a97495a92b57c9d1667ac8876 in OpenFOAM-dev

henry

2015-05-28 20:43

manager   ~0004831

Resolved by

commit 80f923d0f16ff08e25983b6c6aa58629e8a691f1 in OpenFOAM-dev
commit bfb49fc90e91deed8afd87252fa8d90669580176 in OpenFOAM-2.4.x

user1152

2015-05-29 08:33

  ~0004833

Note:
In
"
commit 139084f451dc471d3af82e62a73196bfa81a66dc in OpenFOAM-2.4.x
commit e8c7aac911d7130a97495a92b57c9d1667ac8876 in OpenFOAM-dev
" -> https://github.com/OpenFOAM/OpenFOAM-2.4.x/commit/139084f451dc471d3af82e62a73196bfa81a66dc
At line 16 of "applications/solvers/lagrangian/DPMFoam/createFields.H", one has been missed. It still attempts to get "contiuousPhaseName" from the transportProperties dictionary.

henry

2015-05-29 08:49

manager   ~0004834

Resolved in OpenFOAM-2.4.x by commit 25d770656040baecf1a0b2a429b97b026bc1262a

No issue is OpenFOAM-dev

Issue History

Date Modified Username Field Change
2015-05-28 16:05 user1152 New Issue
2015-05-28 16:05 user1152 File Added: MPPICFoam_bugCase.tar
2015-05-28 17:04 henry Note Added: 0004830
2015-05-28 20:43 henry Note Added: 0004831
2015-05-28 20:43 henry Status new => resolved
2015-05-28 20:43 henry Resolution open => fixed
2015-05-28 20:43 henry Assigned To => henry
2015-05-29 08:33 user1152 Note Added: 0004833
2015-05-29 08:33 user1152 Status resolved => feedback
2015-05-29 08:33 user1152 Resolution fixed => reopened
2015-05-29 08:49 henry Note Added: 0004834
2015-05-29 08:49 henry Status feedback => resolved
2015-05-29 08:49 henry Resolution reopened => fixed