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

Incompatible dimensions for operation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 14, 2009, 10:17
Default Incompatible dimensions for operation
  #1
Member
 
Pramod
Join Date: Jul 2009
Posts: 30
Rep Power: 17
pramodopen4foam is on a distinguished road
Hi friends,
I tried to combine solvers settlingFoam and bubbleFoam, I could compile successfully, bu when I ran my solver, which gives error, which states,
incompatible dimensions for operation
[alpha[0 0 -1 0 0 0 0] ] + [alpha[1 -3 -1 0 0 0 0] ]#0 Foam::error:rintStack(Foam::Ostream&) in "/home/baburao/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/baburao/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 void Foam::checkMethod<double>(Foam::fvMatrix<double> const&, Foam::fvMatrix<double> const&, char const*) in "/home/baburao/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/comsol"
#3 Foam::tmp<Foam::fvMatrix<double> > Foam:perator+<double>(Foam::tmp<Foam::fvMatrix<d ouble> > const&, Foam::tmp<Foam::fvMatrix<double> > const&) in "/home/baburao/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/comsol"
#4 main in "/home/baburao/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/comsol"
#5 __libc_start_main in "/lib/libc.so.6"
#6 _start at /build/buildd/glibc-2.9/csu/../sysdeps/x86_64/elf/start.S:116


From function checkMethod(const fvMatrix<Type>&, const fvMatrix<Type>&)
in file /home/baburao/OpenFOAM/OpenFOAM-1.5/src/finiteVolume/lnInclude/fvMatrix.C at line 1184.

FOAM aborting


Can anyone help with this errorsince I am very new to OpenFoam and C++,

Thanks in advance,

Anticipating for your kind reply,

Pramod
pramodopen4foam is offline   Reply With Quote

Old   October 14, 2009, 10:25
Default
  #2
Member
 
Sachin Kanetkar
Join Date: Mar 2009
Posts: 57
Rep Power: 17
sachin is on a distinguished road
I guess there is problem with "rho" could u write the alphaEqn

Sachin
sachin is offline   Reply With Quote

Old   October 14, 2009, 11:06
Default
  #3
Member
 
Pramod
Join Date: Jul 2009
Posts: 30
Rep Power: 17
pramodopen4foam is on a distinguished road
alphaEqn has been attached,

Thanks for your response Sachin

Pramod
Attached Files
File Type: h alphaEqn.H (1.2 KB, 200 views)
pramodopen4foam is offline   Reply With Quote

Old   October 14, 2009, 12:43
Default
  #4
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23
l_r_mcglashan will become famous soon enough
You're obviously using the compressible formulation of 'phi', which includes the density, and that's why you have a dimensions mismatch.
Before 'sticking' codes together, make sure you know exactly what equations you are solving for. If you look at the difference between the alphaEqn in settlingFoam and bubbleFoam the reason it isn't working should be obvious.
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   October 14, 2009, 12:54
Default
  #5
Member
 
Pramod
Join Date: Jul 2009
Posts: 30
Rep Power: 17
pramodopen4foam is on a distinguished road
yes , as I mentioned since I dont know C++ upto the mark , I tried to stick with the solvers. Sorry to tell this, can anyone help me regarding this,

Thanks in advance,
pramodopen4foam is offline   Reply With Quote

Old   October 14, 2009, 13:02
Default
  #6
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23
l_r_mcglashan will become famous soon enough
This doesn't have anything to do with C++. I am assuming that you are solving:

fvm::ddt(alpha) + fvm::div(phi,alpha) + whatever

The problem you have is that your dimensions are different. alpha is dimensionless so the first term will have a dimension of s^{-1}. The second term has phi, which has dimensions of m^3 s^{-1}, and alpha which is dimensionless, so that term should also have dimensions of s^{-1}.

You are calculating phi using something akin to rho*U, which means your phi has different dimensions to the phi in the equation above.

Is your case compressible/incompressible?
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   October 14, 2009, 14:44
Default
  #7
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
In bubbleFoam the flux is volumetric:

phia = fvc::interpolate(Ua) & mesh.Sf();

in settlingFoam phi is created with compressibeCreatePhi.H in createFields.H

What is the purpose of combining these two codes?
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   October 15, 2009, 05:24
Default
  #8
Member
 
Pramod
Join Date: Jul 2009
Posts: 30
Rep Power: 17
pramodopen4foam is on a distinguished road
Quote:
Originally Posted by l_r_mcglashan View Post
This doesn't have anything to do with C++. I am assuming that you are solving:

fvm::ddt(alpha) + fvm::div(phi,alpha) + whatever

The problem you have is that your dimensions are different. alpha is dimensionless so the first term will have a dimension of s^{-1}. The second term has phi, which has dimensions of m^3 s^{-1}, and alpha which is dimensionless, so that term should also have dimensions of s^{-1}.

You are calculating phi using something akin to rho*U, which means your phi has different dimensions to the phi in the equation above.

Is your case compressible/incompressible?
Firstly thank you very much for your patient response Laurence, its helping me

I am solving with incompressible fluids,
I am open for any suggesstion

Thank you
pramodopen4foam is offline   Reply With Quote

Old   October 15, 2009, 06:00
Default
  #9
Member
 
Pramod
Join Date: Jul 2009
Posts: 30
Rep Power: 17
pramodopen4foam is on a distinguished road
Quote:
Originally Posted by alberto View Post
In bubbleFoam the flux is volumetric:

phia = fvc::interpolate(Ua) & mesh.Sf();

in settlingFoam phi is created with compressibeCreatePhi.H in createFields.H

What is the purpose of combining these two codes?
Thanks alberto for your response, I am trying to combine the codes since my case has both setlingFoam n bubbleFoam involved,

Any suggestions are welcome,
Thank you
pramodopen4foam is offline   Reply With Quote

Old   December 19, 2023, 15:29
Default incompatible dimensions for operation
  #10
New Member
 
Miguel
Join Date: Aug 2023
Posts: 1
Rep Power: 0
Miguel António is on a distinguished road
Hi Pessola, I need help to resolve this error.

--> FOAM FATAL ERROR:
incompatible dimensions for operation
[CH4[1 -3 -1 0 0 0 0] ] + [CH4[-1 0 -1 0 1 0 0] ]

From function void Foam::checkMethod(const Foam::fvMatrix<Type>&, const Foam::fvMatrix<Type>&, const char*) [with Type = double]
in file /home/miguel/OpenFOAM/OpenFOAM-8/src/finiteVolume/lnInclude/fvMatrix.C at line 1256.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 void Foam::checkMethod<double>(Foam::fvMatrix<double> const&, Foam::fvMatrix<double> const&, char const*) in "/home/miguel/OpenFOAM/miguel-8/platforms/linux64GccDPInt32Opt/bin/myporousGasificationFoam"
#3 Foam::tmp<Foam::fvMatrix<double> > Foam::operator+<double>(Foam::tmp<Foam::fvMatrix<d ouble> > const&, Foam::tmp<Foam::fvMatrix<double> > const&) in "/home/miguel/OpenFOAM/miguel-8/platforms/linux64GccDPInt32Opt/bin/myporousGasificationFoam"
#4 ? in "/home/miguel/OpenFOAM/miguel-8/platforms/linux64GccDPInt32Opt/bin/myporousGasificationFoam"
#5 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#6 ? in "/home/miguel/OpenFOAM/miguel-8/platforms/linux64GccDPInt32Opt/bin/myporousGasificationFoam"
Abortado (imagem do núcleo gravada)
Miguel António is offline   Reply With Quote

Old   January 4, 2024, 05:51
Smile incompatible Dimensions
  #11
New Member
 
Karthik Lukka
Join Date: Nov 2022
Location: Roorkee, India
Posts: 2
Rep Power: 0
Kar93 is on a distinguished road
Hi Miguel,
I think the error might have crept in when you did not change the units of pressure while trying to create your own case.

Recently, I have fixed this error !!! Let me know if I am correct on this and hope this should soothe you.

Regards,
Karthik.
Kar93 is offline   Reply With Quote

Reply

Tags
incompatible dimensions


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
Different dimensions for FATAL ERROR retech OpenFOAM Running, Solving & CFD 2 August 14, 2007 11:17
Dimensions of laplacian in PISO loop kumar2 OpenFOAM Running, Solving & CFD 2 July 3, 2006 15:34
How to change the dimensions in STAR-CD? Particle Siemens 5 April 23, 2006 11:16
Fluent: changing dimensions of a geometry genetaed Madhukar Rapaka FLUENT 3 October 12, 2005 12:40
SOURCE DIMENSIONS Andreas Abdon CFX 1 March 13, 2000 11:51


All times are GMT -4. The time now is 07:35.