Dear foamers,
I have found some bugs in foam-extend3.1 and foam-extend3.2
My test case is /heatTransfer/buoyantBoussinesqPisoFoam/hotRoom
[1]bugs in foam-extend 3.1
I changed the pressure boundary from buoyantPressure to fixedFluxPressure,
floor
{
type fixedFluxPressure;
rho rhok;
value uniform 0;
adjoint false;
}
ceiling
{
type fixedFluxPressure;
rho rhok;
value uniform 0;
adjoint false;
}
fixedWalls
{
type fixedFluxPressure;
rho rhok;
value uniform 0;
adjoint false;
}
then foam-extend3.1 occurs some errors:
Time = 1
Courant Number mean: 0 max: 0 velocity magnitude: 0
DILUPBiCG: Solving for Ux, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 8.12238e-06, No Iterations 4
DILUPBiCG: Solving for Uz, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for T, Initial residual = 1, Final residual = 2.56071e-06, No Iterations 6
--> FOAM FATAL ERROR:
lookup of (1|A(U)) from objectRegistry region0 successful
but it is not a volScalarField, it is a surfaceScalarField
From function objectRegistry::lookupObject<Type>(const word&) const
in file /home/Aaron/foam/foam-extend-3.1/src/foam/lnInclude/objectRegistryTemplates.C at line 120.
FOAM aborting
[2]bugs in foam-extend3.2
then, I run the above case in foam-extend3.2 use one cpu thread, I found it can run!!! and with out "lookup of (1|A(U)) from objectRegistry region0 successful, but it is not a volScalarField, it is a surfaceScalarField" bugs.
However, when I use mpirun, it occurs bugs:
Running setHotRoom on /media/Aaron/disk/tutorials_fe31/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom_test
[0] [1]
[1]
[1] --> FOAM FATAL IO ERROR:
[1] wrong token type - expected word found on line 28 the punctuation token '('
[1]
[1] file: /media/Aaron/disk/tutorials_fe31/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom_test/processor1/0/p::boundaryField::floor::rAU at line 28.
[1]
[1] From function operator>>(Istream&, word&)
[1] in file primitives/strings/word/wordIO.C at line 76.
[1]
FOAM parallel run exiting
[0]
[0] --> FOAM FATAL IO ERROR:
[0] wrong token type - expected word found on line 28 the punctuation token '('
[0]
[0] file: /media/Aaron/disk/tutorials_fe31/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom_test/processor0/0/p::boundaryField::floor::rAU at line 28.
[0]
[0] From function operator>>(Istream&, word&)
[0] in file primitives/strings/word/wordIO.C at line 76.
[0] [1]
FOAM parallel run exiting
[0]
MPI_ABORT was invoked on rank 1 in communicator MPI_COMM_WORLD
with errorcode 1.
Can someone help me solve this bug?
Best Regrads,
Aaron
Hi Aaron,
this is not really a bug. It think it is rather a problem of inconsistency. The fixedFluxPressure boundary condition needs the field 1.0/UEqn.A() in order to derive a pressure gradient value based on the the flux represented by the UEqn.
The field 1.0/UEqn.A() is however defined in an extremely inconsistent way in OpenFOAM and foam-extend. Often it is simply referred to as rAU, sometimes as rUA, 1|A(U) or (1|A(U)). Authors have their own preferences which may lead to some confusion if you compare different solvers. Things get even worse, as the surface interpolated pendant is being used for the pEqn, too. Here you will find rAUf, rUAf but also 1|A(U) or (1|A(U)).
Furthermore the implementation of the fixedFluxPressure boundary condition is completely different in vanilla OpenFOAM 2.2.x, 2.3.x, 3.0.x and foam-extend.
To solve your problem, you have to look into the definition of the fixedFluxPressure patch field of foam-extend 3.2. Focus on the dictionary constructor of the fixedFluxPressureFvPatchScalarField starting from line 49:
fixedFluxPressureFvPatchScalarField.C.
It reads all the necessary field names from the boundaryField section given in your p field:
Per default it uses the rAUName "1|A(U)" if you do not specify anything else.
Now have a look at the pEqn.H of your desired solver:
pEqn.H.
As you might recognize, the buoyantBoussinesqPisoFoam uses the name "rUA" for the cell based 1.0/UEqn.A() and "(1|A(U))" for the interpolated one:
The problem here is that during the coefficient update of the fixedFluxPressureFvPatchScalarField:
fixedFluxPressureFvPatchScalarField.C,
the database is first queried for "(1|A(U))" as volScalarField:
Unfortunately, the default name "(1|A(U))" is already registered as the interpolated field and this is probably what the error massage is about.
This could for sure be improved in the implementation of the fixedFluxPressureFvPatchScalarField, the objectRegistry or/and by means of a more consistent naming of 1.0/UEqn.A() throughout the whole foam-extend code, if I'm not completely wrong. But in order to get your case running it might be enough to simply specify the "correct" name of 1.0/UEqn.A() for the buoyantBoussinesqPisoFoam solver.
Please change your boundary conditions of p to something like
and make sure you decompose your case afterwards or change each processor folder separately. The adjoint switch is turned off by default. Just drop it.
Hopefully, this will solve it. Please let me know if this does not work!
Best,
Pascal
Last edit: Pascal Beckstein 2016-06-08
Dear Pascal,
Thanks for your detailed explanation, it really helps me a lot
After add "rAU rUA; " the solver works fine.
Best Regrads,
Aaron
Dear Pascal,
thanks for your detailed explanation. I am using foam-extend 4.0 and this inconsistency is still there. However, after reading your post, one should add something like
because it is defined as rAU in the solver and (1|A(U)) in the fixedFluxPressure.
The problem comes later. So, I am decomposing the case into a number of processors and the solver (for example interFoam) runs fine. When it is the time to reconstruct the case, openfoam still searches for inconsistent variables. So, here is the error
Any ideas of how to solve this problem?
Thanks in advance!
Thomas N.
Hi,
I has some progress with this problem. Thus, in parallel computing the field rAU is saved as
and the reason that it cannot reconstruct it is this. When I am changing the (1|A(U)) to rAU is reconstructing normal. So i believe if I change the way that is being saved, problem is solved. Any ideas how can I do this by changing the boundary conditions?
Thanks in advance!
Thomas N.
Hi,
so like I said the (1|A(U)) should be replaced with rAU and I couldn't fix this from the fixedFluxPressure. However, I fixed it by creating a python script that will search all the (1|A(U)) and replace them with rAU. Here is how it looks like:
I hope it helps.
Thomas N.