CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

error in 2.3.0 - Dimensions of phi are not correct

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 8, 2014, 05:31
Default error in 2.3.0 - Dimensions of phi are not correct
  #1
New Member
 
Anurag M
Join Date: Aug 2014
Posts: 22
Rep Power: 2
anuragm is on a distinguished road
Hello,

I am quite new to OpenFOAM and have run into some problems. I am trying to implement a solver for a multiphase system coupled with population balance (DQMOM). For this purpose, I am using a modified twoPhaseEulerFoam solver. The code was not written by me, I am just trying to edit it and implement if for my problem. The solver code was originally written for version 1.6 and I am using for OpenFOAM 2.3.0. However, whenever I run the solver on my test case, I get the following error:

Code:
--> FOAM FATAL ERROR:
dimensions of phi are not correct

    From function CrankNicolsonDdtScheme<Type>::fvcDdtPhiCorr
    in file finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C at line 1162.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) in "/home/misra/OpenFOAM/misra-2.3.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::error::abort() in "/home/misra/OpenFOAM/misra-2.3.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  Foam::fv::CrankNicolsonDdtScheme<Foam::Vector<double> >::fvcDdtPhiCorr(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) in "/home/misra/OpenFOAM/misra-2.3.0/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#3
 in "/home/misra/OpenFOAM/misra-2.3.0/platforms/linux64GccDPOpt/bin/multiPhasePbeFoam"
#4
 in "/home/misra/OpenFOAM/misra-2.3.0/platforms/linux64GccDPOpt/bin/multiPhasePbeFoam"
#5  __libc_start_main in "/lib64/libc.so.6"
#6
 in "/home/misra/OpenFOAM/misra-2.3.0/platforms/linux64GccDPOpt/bin/multiPhasePbeFoam"
Aborted
The same error also pops up if I change the scheme from CrankNicolson to Euler. I would be glad if someone helps or at least points me in the right direction. I checked the initial conditions and the pEqns.H file to check if there is a problem with the dimensions of phi. But no luck and I have no clue where to proceed at this stage.

The multiphase solver (multiPhasePbeFoam) can be found here and the test case (using 3 moments) is here.

Regards,
Anurag

PS: Because of the version differences, I replaced ddtPhiCorr with ddtCorr in pEqn.H as per this post. The solver would not compile without this change.

Last edited by anuragm; September 11, 2014 at 03:47. Reason: Added more information
anuragm is offline   Reply With Quote

Old   September 11, 2014, 03:45
Default
  #2
New Member
 
Anurag M
Join Date: Aug 2014
Posts: 22
Rep Power: 2
anuragm is on a distinguished road
To add to the above post, the solver is a modification of twoPhaseEulerFoam - it has been modified to solve for n (dispersed) + 1 (continuous) phases.
anuragm is offline   Reply With Quote

Old   September 14, 2014, 05:27
Default
  #3
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Anurag,

It requires a lot of coding changes, not simply a replacement of "ddtPhiCorr with ddtCorr"

Given the complexity of the code, I'll only be able to give you a few indications on how to proceed:
  1. Download this file: https://github.com/OpenFOAM/OpenFOAM...lerFoam/pEqn.H - click on the "Raw" button to download it. This is the file "pEqn.H" for the solver twoPhaseEulerFoam in OpenFOAM 2.2.x.
  2. Place the file in the same folder "multiPhasePbeFoam" with a new name, e.g. "pEqn22x.H".
  3. Now, from the folder "multiPhasePbeFoam", run this command:
    Code:
    diff -Nur pEqn22x.H $FOAM_SOLVERS/multiphase/twoPhaseEulerFoam/pEqn.H > 22xVS230.patch
  4. If all goes well, you should now have a file named "22xVS230.patch" with a complete list of the changes that were made from OpenFOAM 2.2.x to 2.3.0. And you'll see why it isn't a quick/simple solution I could explain to you here. But you can now use that file as a reference guide as to which changes you need to do in the "pEqn.H" of your solver.
Good luck! Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   September 17, 2014, 04:39
Default
  #4
New Member
 
Anurag M
Join Date: Aug 2014
Posts: 22
Rep Power: 2
anuragm is on a distinguished road
Hi Bruno,

Thank you for the reply. Your suggestion was helpful. I am trying to see how different are the new pEqn.H files from the older ones (for both twoPhaseEulerFoam and multiPhaseEulerFoam). In my case, the twoPhaseEulerFoam solver was modified to solve for n+1 phases. So you are correct, the corrections will not be straightforward.

I will post again in case I encounter more difficulties.

Regards,
Anurag
anuragm is offline   Reply With Quote

Old   September 18, 2014, 03:42
Default
  #5
New Member
 
Anurag M
Join Date: Aug 2014
Posts: 22
Rep Power: 2
anuragm is on a distinguished road
Hi Bruno,

I compiled the solver again making some changes in the pEqn.H file. This time I receive the following error message.

Code:
--> FOAM FATAL ERROR:
Different dimensions for +=
     dimensions : [1 0 -1 0 0 0 0] = [0 3 -1 0 0 0 0]

    From function dimensionSet::operator+=(const dimensionSet&) const
    in file dimensionSet/dimensionSet.C at line 185.

FOAM aborting

#0   Foam::error::printStack(Foam::Ostream&) in  "/home/misra/OpenFOAM/misra-2.3.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::error::abort() in "/home/misra/OpenFOAM/misra-2.3.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2   Foam::dimensionSet::operator+=(Foam::dimensionSet const&) const in  "/home/misra/OpenFOAM/misra-2.3.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#3   Foam::DimensionedField<double,  Foam::surfaceMesh>::operator+=(Foam::DimensionedField<double,  Foam::surfaceMesh> const&) at  ~/OpenFOAM/OpenFOAM-2.3.0//src/OpenFOAM/lnInclude/DimensionedField.C:508
#4   Foam::GeometricField<double, Foam::fvsPatchField,  Foam::surfaceMesh>::operator+=(Foam::GeometricField<double,  Foam::fvsPatchField, Foam::surfaceMesh> const&) at  ~/OpenFOAM/OpenFOAM-2.3.0//src/OpenFOAM/lnInclude/GeometricField.C:1215
#5   Foam::GeometricField<double, Foam::fvsPatchField,  Foam::surfaceMesh>::operator+=(Foam::tmp<Foam::GeometricField<double,  Foam::fvsPatchField, Foam::surfaceMesh> > const&) at  ~/OpenFOAM/OpenFOAM-2.3.0//src/OpenFOAM/lnInclude/GeometricField.C:1215
#6
 at ~/OpenFOAM/misra-2.3.0/applications/solvers/multiphase/multiPhasePbeFoam/pEqn.H:25
#7  __libc_start_main in "/lib64/libc.so.6"
#8
 in "/home/misra/OpenFOAM/misra-2.3.0/platforms/linux64GccDPOpt/bin/multiPhasePbeFoam"
Aborted
Specifically, the offending line seems to be

Code:
phiDragb   += fvc::interpolate((alpha[i]/rhob)*K[i]*rUbA)*phia[i];
in the following pEqn.H file

http://pastebin.com/HEEe22Ff

Do you have any ideas where to go from this point?

Regards,
Anurag
anuragm is offline   Reply With Quote

Old   September 18, 2014, 05:30
Default
  #6
New Member
 
Anurag M
Join Date: Aug 2014
Posts: 22
Rep Power: 2
anuragm is on a distinguished road
I managed to solve the above error by adding the following lines to my pEqn.H file

Code:
surfaceScalarField phiDragb
    (
        IOobject
        (
            "phiDragb",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        mesh,
        dimensionedScalar("phiDragb", dimArea*dimVelocity, 0)
    );

In essence, I defined the offending variable (phiDragb) to have the required dimensions.

Right now I am trying unsuccessfully calculate the deformation rate tensor. The problem seems to be similar - related to the dimensions. I am trying to solve this one and will post here again in case I hit a wall.
anuragm is offline   Reply With Quote

Old   September 23, 2014, 08:51
Default
  #7
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 545
Rep Power: 12
vasava will become famous soon enough
@anuragm: Can you post your solver files here please??
vasava is offline   Reply With Quote

Old   November 17, 2014, 06:27
Default
  #8
New Member
 
Anurag M
Join Date: Aug 2014
Posts: 22
Rep Power: 2
anuragm is on a distinguished road
Hi Vasava,

I am sorry but I saw your post only now. I figured I needed to understand the basics behind my problem before I could seek further help here on this forum. Although I could make the solver run, I had some problems with my results. So I am trying a different approach. I have been working on implementing DQMOM in the multiphaseEulerFoam solver in OpenFOAM 2.1.1/2.3.x on my own.

I dont know if you were looking for help or offering it.

PS: My solver files were uploaded and linked in the first post.
anuragm is offline   Reply With Quote

Old   November 17, 2014, 09:25
Default
  #9
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 545
Rep Power: 12
vasava will become famous soon enough
Thanks anuragm!. At that time I was exploring possibilities of using population balance within openfoam and was keen about your solver and problem. Can you re-post the solver if you have made any modifications. Also a test example would also be of great help.

Thanks for replying!!
vasava is offline   Reply With Quote

Old   November 18, 2014, 13:56
Default
  #10
New Member
 
Anurag M
Join Date: Aug 2014
Posts: 22
Rep Power: 2
anuragm is on a distinguished road
Hi Vasava,

I will upload the files this week. Just to let you know, I was having problems with the effect of gravity. Let me know if you are able to validate the results using these files.
anuragm is offline   Reply With Quote

Old   November 26, 2014, 08:47
Default
  #11
New Member
 
Anurag M
Join Date: Aug 2014
Posts: 22
Rep Power: 2
anuragm is on a distinguished road
Hi Vasava,

After talking to my colleagues at work, I'm afraid I cannot send you the files because I do not own the code. It is best you contact the original authors of the paper.

Development and implementation of a polydispersed multiphase flow model in OpenFOAM
anuragm is offline   Reply With Quote

Old   November 27, 2014, 02:46
Default
  #12
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 545
Rep Power: 12
vasava will become famous soon enough
Thats ok. I will send them message my self.
vasava is offline   Reply With Quote

Old   November 30, 2014, 01:16
Default
  #13
Senior Member
 
Tushar Chourushi
Join Date: Jul 2009
Location: IIT-Indore, India
Posts: 318
Blog Entries: 1
Rep Power: 9
Tushar@cfd is on a distinguished road
Quote:
Originally Posted by anuragm View Post
Hi Vasava,

After talking to my colleagues at work, I'm afraid I cannot send you the files because I do not own the code. It is best you contact the original authors of the paper.

Development and implementation of a polydispersed multiphase flow model in OpenFOAM
Dear Anurag,

I think the problem is with the dimensions of the code line. Since, you cannot share your data due to some constraints. I would advice you to check the dimension of both the RHS terms of the below mentioned equation.

Code:
        phiDraga[i] = fvc::interpolate(beta/phasea[i].rho()*K[i]*rUaA)*phib
                    + rUaAf[i]*(g & mesh.Sf());
I hope it will resolve your error.

-
Best Luck!
Tushar@cfd is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
interFoam | Hydraulic Jump | Correct boundary condition p_rgh pythag0ra5 OpenFOAM Running, Solving & CFD 17 September 5, 2014 04:31
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
phi -= pEqn.flux() vs. linearInterpolate(U) & mesh.Sf() santiagomarquezd OpenFOAM Programming & Development 32 June 12, 2014 01:50
porousInterFoam - problem setting correct bcs Natalie2210 OpenFOAM Running, Solving & CFD 2 December 2, 2013 06:26
Dimensions of laplacian in PISO loop kumar2 OpenFOAM Running, Solving & CFD 2 July 3, 2006 14:34


All times are GMT -4. The time now is 01:14.