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

dimensioned problem in potentialFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 20, 2012, 10:31
Default dimensioned problem in potentialFoam
  #1
New Member
 
Join Date: Mar 2012
Posts: 20
Rep Power: 14
T.Matrix is on a distinguished road
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.
T.Matrix is offline   Reply With Quote

Old   December 20, 2012, 15:36
Default
  #2
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
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
Lieven is offline   Reply With Quote

Old   December 21, 2012, 21:23
Default
  #3
New Member
 
Join Date: Mar 2012
Posts: 20
Rep Power: 14
T.Matrix is on a distinguished road
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
);
T.Matrix is offline   Reply With Quote

Old   December 22, 2012, 05:16
Default
  #4
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
Dear T.Matrix,

Quote:
So, in my opinion, p is created with no dimension..
The dimensions are not given explicitly in the source code but they are effectively read from the input file because IOobject::MUST_READ is set. This give the user the flexibility to chose them himself. Only when IOobject::MUST_READ would be IOobject::NO_READ or IOobject::READ_IF_PRESENT on the other hand, they would need to be provided in the source code.

If you add
Code:
Info << p.dimensions() << endl;
just before
Code:
p = dimensionedScalar("zero", p.dimensions(), 0.0);
you can verify yourself that the dimensions are taken from the input file (simply change them a few times)

The only reason
Code:
p = dimensionedScalar("zero", p.dimensions(), 0.0);
is added to the createFields.H is to reset the pressure field to 0.

Kind regards,

L
Lieven is offline   Reply With Quote

Old   December 22, 2012, 06:48
Default
  #5
New Member
 
Join Date: Mar 2012
Posts: 20
Rep Power: 14
T.Matrix is on a distinguished road
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
T.Matrix is offline   Reply With Quote

Reply

Tags
dimensioned


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
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


All times are GMT -4. The time now is 03:42.