|
[Sponsors] |
December 20, 2012, 10:31 |
dimensioned problem in potentialFoam
|
#1 |
New Member
Join Date: Mar 2012
Posts: 20
Rep Power: 14 |
there is a define of pressure p as follow in the createFields.H in the potentialFoam:
volScalarField p ( IOobject ( "p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ), mesh ); p = dimensionedScalar("zero", p.dimensions(), 0.0); In my opinion, the pressure p is created with dimensionedless at first, and then assign its dimension according to dimensionedScalar("zero", p.dimensions(), 0.0). However, when p.dimensions() is called, the dimension of p in left is still dimensionless. Therefore, the dimension of p is not given. At the same time, the same problem is also exist in the velocity U. |
|
December 20, 2012, 15:36 |
|
#2 |
Senior Member
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22 |
Hey T.Matrix,
The dimensions of p and U should be read from the input files. So if p.dimensions() is dimensionless, you should check the dimension set specified in 0/p and 0/U of the case. Kind regards, L |
|
December 21, 2012, 21:23 |
|
#3 |
New Member
Join Date: Mar 2012
Posts: 20
Rep Power: 14 |
Hi Lieven,
the dimensions of p and U is given in the input files as normal, and potentialFoam can run correctly. However, the problem is how the dimensions is assigned in the source code. As far as I am concerned, volscalarField p is created by calling construction function GeometricField(*,*,*). In the following code, dimensions is not given to the construction GeometricField. Therefore, pressure p is created using the default dimension which is set dimensionless in the construction. So, in my opinion, p is created with no dimension. In fact, when source code is executed, p has its own dimension. I can't understand it. volScalarField p ( IOobject ( "p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ), mesh ); |
|
December 22, 2012, 05:16 |
|
#4 | |
Senior Member
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22 |
Dear T.Matrix,
Quote:
If you add Code:
Info << p.dimensions() << endl; Code:
p = dimensionedScalar("zero", p.dimensions(), 0.0); The only reason Code:
p = dimensionedScalar("zero", p.dimensions(), 0.0); Kind regards, L |
||
December 22, 2012, 06:48 |
|
#5 |
New Member
Join Date: Mar 2012
Posts: 20
Rep Power: 14 |
Hello L,
If Oobject::MUST_READ is set, the dimension is read from input file. However, the dimension is saved in a temporary IOobject. I just do not know how this temporary IOobject transport its dimension to dimension in volScalarField. I read relative codes several days but have no idea. Matrix.T |
|
Tags |
dimensioned |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with interFoam; Wave/wiggle alpha1 behavior | JonW | OpenFOAM | 10 | February 4, 2023 08:27 |
UDF compiling problem | Wouter | Fluent UDF and Scheme Programming | 6 | June 6, 2012 05:43 |
Problem in implementing cht | tilek | CFX | 3 | May 8, 2011 09:39 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 07:29 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 20:13 |