Incompatible dimensions....
Hi all. A CFX and Fluent user having a go at OpenFOAM, and currently making a right hash of it! :o
OK, simply put, I'm trying to take the existing simpleFoam tutorial pitzDaily and use it on a different mesh (a NACA0012) to get me started. However, I keep getting the following error: incompatible dimensions for operation [U[0 1 -2 0 0 0 0] ] == [-grad(p)[0 -3 -2 0 0 0 0] ] From function checkMethod(const fvMatrix<Type>&, const GeometricField<Type, fvPatchField, volMesh>&) in file ..\..\src\finiteVolume\lnInclude/..\fvMatrices\fvMatrix\/fvMatrix.C at line 1208. Obviously, I assumed it was inconsistent dimensions on by "boundary" files within the /0/ folder, however, the dimensions are correct, and are exactly the same as within the OpenFOAM tutorial folder. After which, I have tried to check whether my mesh is at fault, but checkMesh comes back ok - but I suppose it will not be checking my boundary file within /constant/. I've tried various different mesh, including those available from Polito* for use with AeroFoam - modified for simpleFoam usage, with no success. *http://www.aero.polimi.it/freecase/?...namic_problems Anyone any ideas? Even just of where exactly I am being stupid! |
In addition to the above, I can obtain results using potentialFoam... where just U & p are required.
From that, I am guessing that the error lies in how I am relating my boundary conditions to the solver. Either within the /constant/ or /system/ directory, however none of the files within those directories leaps out at me as being the culprit. |
Another post.
Of course, the solver can be got running by screwing around with the dimensions of the input files... (icoFoam used below) But is it expected to run at p (pressure?) dimensions of [ 0 2 -2 0 0 0 0] As as as I am aware, that is m^2/s^2 ?!?! Whereas I would be expecting: [ 1 -1 -2 0 0 0 0] i.e. kg/m/s^2 |
For airfoil, why not try the airFoil2d example under the same simpleFoam folder?
I thought p is p/density with that dimension. I have the same question about the cavity example under the potentialFoam. |
Quote:
|
Ahh, thanks folks. :)
|
one question
Quote:
Hi gwierink, I have one question on that. If I run my simulation with rhoSimpleFoam, based on the results of simpleFoam, i.e., I set my startTime to latestTime. Then I have to modify the pressure units. (From density normalized to normal pressure.) Do I also have to change the values of the field? Thank you very much. Tao |
Hi Tao,
I suppose yes, since the pressure used in simpleFoam is actually pressure divided by density (see also Section 3.1.2 of the OpenFOAM Wiki) (and this thread with followup). |
Hi Tao,
As said by Gijs, you have to put the real value for the pressure. Indeed in a compressible solver an equation of state is used (usually the perfect gas law) and the density will be deduced from the temperature and the pressure using that law. In case of the perfect law: rho = p/rT In the code: http://foam.sourceforge.net/docs/cpp..._8H_source.php line 73 Regards, Frederic |
Hi,
is there a way to get the dimension of a vol/surfaceScalarField? |
Hello Illya,
Yes, you have to call the functions dimensions. For example U.dimensions(). Or you can just write the field by calling the function write (e.g. p.write() ). Then the dimensions are explicitly appearing at the begin of the file (keyword dimensions). Best regards, Frederic Collonval |
Thanks Frederic for the rapid answer!
Another question: I have a surface scalar field: Code:
surfaceScalarField DN2Rhof but when I build the divergence Code:
volScalarField Test = fvc::div(DN2Rhof) I thought, the divergence operator has the dimension 1/m, so div(DN2Rhof) should be [1 -2 -1 0 0 0 0], but it doesn't.. Could someone please give me a hint? |
Hello Illya,
The surfaceField are presumed to be equal to field*Aface (have a look for example to phi in incompressible flow; phi = U*Aface [m^3/s]). So the div operator is simply the sum of surfaceField on each cell-surfaces finally divided by the mesh volume. Best regards, Frederic |
SimpleFoam or potentialFoam
Hi,
I'm thinking about using potentialFoam instead of simpleFoam. In my case I have an incompressible, isothermal and slow (Re<10) flow. I've read somewhere that one can use for very slow and incompressible flows the "potetial theory" to calculate it. Is this correct and does this mean that I can use potentialFoam to compute the flux in OpenFoam? best regards |
All times are GMT -4. The time now is 10:26. |