|
[Sponsors] |
October 21, 2016, 02:26 |
Dimension Error in OpenFOAM
|
#1 |
New Member
Harshal Akolekar
Join Date: Aug 2016
Location: Melbourne
Posts: 25
Rep Power: 9 |
Hi everyone,
I am trying to run a simulation around using rhoPimpleFoam. However, as soon as I run this I get the following error message. --> FOAM FATAL ERROR: Arguments of max have different dimensions dimensions : [0 0 0 0 0 0 0] and [1 -3 0 0 0 0 0] From function max(const dimensionSet&, const dimensionSet&) in file dimensionSet/dimensionSet.C at line 231. How can this be dealt with?Thank you. Regards, Harshal |
|
October 21, 2016, 08:13 |
|
#2 |
Member
Join Date: Mar 2014
Posts: 39
Rep Power: 12 |
Hey,
have you modified the code ? There could be an inconsistency in your implementation ! Otherwise there seems to be a setup mistake in your case (most probably related to dimensions). Itīs a bit hard to tell from far away whats specificly going wrong there. |
|
October 21, 2016, 22:18 |
|
#3 |
New Member
Harshal Akolekar
Join Date: Aug 2016
Location: Melbourne
Posts: 25
Rep Power: 9 |
Hi everyone,
I found the answer. The dimensions for the pressure file are different for the incompressible case and the compressible case. [0 2 -2 0 0 0 0] - incompressible [1 -1 -2 0 0 0 0] - compressible That was causing the above error. Regards, |
|
January 19, 2019, 14:48 |
Have a similar error while editing code in twoPhaseEulerFoam
|
#4 |
Member
Join Date: Apr 2016
Posts: 30
Rep Power: 10 |
Hi all,
I have edited code in twoPhaseEulerFoam and am getting a similar error. The error is as follows:- Code:
--> FOAM FATAL ERROR: LHS and RHS of + have different dimensions dimensions : [0 0 0 0 0 0 0] + [0 0 -1 0 0 0 0] From function Foam::dimensionSet Foam::operator+(const Foam::dimensionSet&, const Foam::dimensionSet&) in file dimensionSet/dimensionSet.C at line 489. FOAM aborting #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::error::abort() at ??:? #2 Foam::operator+(Foam::dimensionSet const&, Foam::dimensionSet const&) at ??:? #3 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator+<Foam::fvPatchField, Foam::volMesh>(Foam::dimensioned<double> const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:? #4 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator+<Foam::fvPatchField, Foam::volMesh>(double const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:? #5 ? at ??:? #6 __libc_start_main in "/lib64/libc.so.6" #7 ? at ??:? /home/svachha/.lsbatch/1547920500.668919.shell: line 18: 27791 Aborted How do I rectify the error Your help in this matter is greatly appreciated. Thanks and Regards, Shantanu Code:
//#include "Random.H" //#include "StochasticDispersionRAS.H" #include "contErrs.H" Info<< "Constructing momentum equations" << endl; MRF.correctBoundaryVelocity(U1); MRF.correctBoundaryVelocity(U2); MRF.correctBoundaryVelocity(U); fvVectorMatrix U1Eqn(U1, rho1.dimensions()*U1.dimensions()*dimVol/dimTime); fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVol/dimTime); dimensionedScalar dimen ( "dimen", dimensionSet(0,1,1,0,0,0,0), scalar(1.0) ); dimensionedScalar dimen1 ( "dimen1", dimensionSet(0,1,2,0,0,0,0), scalar(1.0) ); volVectorField gr_alpha = fvc::grad(alpha2); volTensorField grU_2 = fvc::grad(U2); volScalarField sc = grU_2 && (grU_2 + grU_2.T()); const scalar csid = 25; const scalar a = 4e-6; const scalar eps = 0.206; //Lift force volScalarField up = .1629+ (.2088/(.1476+(Foam::sqrt(sc)))); const scalar cl = 1.2; volVectorField fsid = U2; // copy of the field; volVectorField fl = U2; volScalarField dis = wallDist(mesh).y(); volVectorField ncap = wallDist(mesh).n(); //Info<<"data="<<dis<<"\n"<<endl; //Info<<"ncap="<<ncap<<"\n"<<endl; Random rnm; forAll(fsid, cellI) { scalar rn = rnm.GaussNormal<scalar>(); fsid[cellI][0] = (Foam::sqrt(sc[cellI]))*alpha2[cellI]*a*eps*rn*csid*-((gr_alpha[cellI][0])/(mag((gr_alpha[cellI]))+ROOTSMALL));//*dimen; fsid[cellI][1] = (Foam::sqrt(sc[cellI]))*alpha2[cellI]*a*eps*rn*csid*-((gr_alpha[cellI][1])/(mag((gr_alpha[cellI]))+ROOTSMALL));//*dimen; fsid[cellI][2] = (Foam::sqrt(sc[cellI]))*alpha2[cellI]*a*eps*rn*csid*-((gr_alpha[cellI][2])/(mag((gr_alpha[cellI]))+ROOTSMALL));//*dimen; } forAll(fl,cellI) { fl[cellI][0] = ((cl*(up[cellI])*(sc[cellI])*a*a*a)/((dis[cellI])+ROOTSMALL))*(ncap[cellI][0]);//*dimen1; fl[cellI][1] = ((cl*(up[cellI])*(sc[cellI])*a*a*a)/((dis[cellI])+ROOTSMALL))*(ncap[cellI][1]);//*dimen1; fl[cellI][2] = ((cl*(up[cellI])*(sc[cellI])*a*a*a)/((dis[cellI])+ROOTSMALL))*(ncap[cellI][2]);//*dimen1; } volScalarField Kd(fluid.Kd()); { volScalarField Vm(fluid.Vm()); { U1Eqn = ( fvm::ddt(alpha1, rho1, U1) + fvm::div(alphaRhoPhi1, U1) - fvm::Sp(contErr1, U1) + MRF.DDt(alpha1*rho1 + Vm, U1) + phase1.turbulence().divDevRhoReff(U1) == - Vm *( fvm::ddt(U1) + fvm::div(phi1, U1) - fvm::Sp(fvc::div(phi1), U1) - DDtU2 ) + fvOptions(alpha1, rho1, U1) ); U1Eqn.relax(); U1Eqn += fvm::Sp(Kd, U1); fvOptions.constrain(U1Eqn); U1.correctBoundaryConditions(); fvOptions.correct(U1); } { U2Eqn = ( fvm::ddt(alpha2, rho2, U2) + fvm::div(alphaRhoPhi2, U2) - fvm::Sp(contErr2, U2) + MRF.DDt(alpha2*rho2 + Vm, U2) + phase2.turbulence().divDevRhoReff(U2) == - Vm *( fvm::ddt(U2) + fvm::div(phi2, U2) - fvm::Sp(fvc::div(phi2), U2) - DDtU1 - fsid - fl ) + fvOptions(alpha2, rho2, U2) ); U2Eqn.relax(); U2Eqn += fvm::Sp(Kd, U2); fvOptions.constrain(U2Eqn); U2.correctBoundaryConditions(); fvOptions.correct(U2); } } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UNIGE February 13th-17th - 2107. OpenFOAM advaced training days | joegi.geo | OpenFOAM Announcements from Other Sources | 0 | October 1, 2016 19:20 |
[Other] mesh spatial dimension in OpenFOAM | jr33 | OpenFOAM Meshing & Mesh Conversion | 4 | May 23, 2016 11:59 |
OpenFOAM Training Beijing 22-26 Aug 2016 | cfd.direct | OpenFOAM Announcements from Other Sources | 0 | May 3, 2016 04:57 |
Superlinear speedup in OpenFOAM 13 | msrinath80 | OpenFOAM Running, Solving & CFD | 18 | March 3, 2015 05:36 |
OpenFOAM Training in Europe and USA | hjasak | OpenFOAM | 0 | August 8, 2008 05:33 |