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

about volScalarField we used

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Display Modes
Old   April 3, 2014, 08:40
Post about volScalarField we used
  #1
Member
 
xuhe-openfoam
Join Date: Aug 2013
Location: DaLian,china
Posts: 82
Rep Power: 3
bieshuxuhe is on a distinguished road
hello !
in the volFieldsFwd.H , there is:
typedef GeometricField<scalar, fvPatchField, volMesh> volScalarField;

there are two "scalar" which are defined in the "scalar.H" as follows:
Code:
36 #ifndef scalar_H
37 #define scalar_H
38 
39 #include "floatScalar.H"
40 #include "doubleScalar.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 #if defined(WM_SP)
45 
46 // Define scalar as a float
47 
48 namespace Foam
49 {
50  typedef floatScalar scalar;
51 
52  static const scalar GREAT = floatScalarGREAT;
53  static const scalar VGREAT = floatScalarVGREAT;
54  static const scalar ROOTVGREAT = floatScalarROOTVGREAT;
55  static const scalar SMALL = floatScalarSMALL;
56  static const scalar VSMALL = floatScalarVSMALL;
57  static const scalar ROOTVSMALL = floatScalarROOTVSMALL;
58 
59  scalar readScalar(Istream& is);
60 }
61 
62 #elif defined(WM_DP)
63 
64 // Define scalar as a double
65 
66 namespace Foam
67 {
68  typedef doubleScalar scalar;
69 
70  static const scalar GREAT = doubleScalarGREAT;
71  static const scalar VGREAT = doubleScalarVGREAT;
72  static const scalar ROOTVGREAT = doubleScalarROOTVGREAT;
73  static const scalar SMALL = doubleScalarSMALL;
74  static const scalar VSMALL = doubleScalarVSMALL;
75  static const scalar ROOTVSMALL = doubleScalarROOTVSMALL;
76 
77  scalar readScalar(Istream& is);
78 }
79 
80 #endif
81 
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 #endif
86 
87 // ************************************************************************* //
I don't find any WM_SP or WM_DP is defined in the openfoam source code.
Then I wonder which scalar is adopted when we use volScalarField to declare "p" in the "createFields.H" ? for example :
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);


the floatScalar or the doubleScalar ? could you help me ?
Thanks !
bieshuxuhe is offline   Reply With Quote

Old   April 3, 2014, 08:43
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,089
Rep Power: 19
alexeym will become famous soon enoughalexeym will become famous soon enough
Hi,

it is passed to the compiler like:

Code:
Making dependency list for source file aFile.C
SOURCE=aFile.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unu ...
it is defined in etc/bashrc

Code:
#    WM_PRECISION_OPTION = DP | SP
export WM_PRECISION_OPTION=DP
bieshuxuhe likes this.
alexeym is online now   Reply With Quote

Old   April 3, 2014, 08:45
Default
  #3
Member
 
xuhe-openfoam
Join Date: Aug 2013
Location: DaLian,china
Posts: 82
Rep Power: 3
bieshuxuhe is on a distinguished road
Thank you !!!
bieshuxuhe is offline   Reply With Quote

Reply

Tags
volscalarfield;scalar

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
libOpenSMOKE Tobi OpenFOAM Programming & Development 496 July 3, 2015 02:41
make a dimensionedScalar to be volScalarField sharonyue OpenFOAM Programming & Development 4 April 2, 2014 05:44
Boundary condition cannot find volScalarField ChrisA OpenFOAM Programming & Development 1 March 18, 2014 18:17
multiplicate all elements of volScalarField with scalar to get new volScalarField maybee OpenFOAM Programming & Development 2 February 18, 2014 16:43
writing execFlowFunctionObjects immortality OpenFOAM Post-Processing 30 September 15, 2013 06:16


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