CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Incompatible dimensions for operation (http://www.cfd-online.com/Forums/openfoam/69178-incompatible-dimensions-operation.html)

pramodopen4foam October 14, 2009 09:17

Incompatible dimensions for operation
 
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::printStack(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::operator+<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

sachin October 14, 2009 09:25

I guess there is problem with "rho" could u write the alphaEqn

Sachin

pramodopen4foam October 14, 2009 10:06

1 Attachment(s)
alphaEqn has been attached,

Thanks for your response Sachin

Pramod

l_r_mcglashan October 14, 2009 11:43

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.

pramodopen4foam October 14, 2009 11:54

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,
:mad:

l_r_mcglashan October 14, 2009 12:02

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?

alberto October 14, 2009 13:44

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?

pramodopen4foam October 15, 2009 04:24

Quote:

Originally Posted by l_r_mcglashan (Post 232623)
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 October 15, 2009 05:00

Quote:

Originally Posted by alberto (Post 232632)
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


All times are GMT -4. The time now is 00:41.