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

Comparison: volScalarField in phaseModel and within main()

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 3, 2014, 07:07
Default Comparison: volScalarField in phaseModel and within main()
  #1
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
hi,

I just tried to implement a new volScalarField in main() of my solver.

I also implemented some fields within phaseModel.H/phaseModel.C and intitialized them with the constructor like

Code:
ONE
    (
        IOobject
        (
            "One" + name,
            mesh.time().timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh,
        dimensionedScalar
             (
              "OneValueOfTheField",
              dimensionSet(0,0,0,0,0,0,0)
             ),
        zeroGradient
    ),
When I tried something similar in main() I had to remove the zeroGradient (I guess the required file to add this inputparameter was not included in main) but also I had to change

Code:
dimensionedScalar
             (
              "OneValueOfTheField",
              dimensionSet(0,0,0,0,0,0,0)
             )
to


Code:
dimensionedScalar
             (
              "OneValueOfTheField",
              dimensionSet(0,0,0,0,0,0,0),
              0
             )
Otherwise I got the error

Quote:
/home/USER/SolverNEW/NEW_TransportEqns.H:32: error: no matching function for call to ‘Foam::dimensioned<double>::dimensioned(const char [20], Foam::dimensionSet)’
Why is the first definition of dimensionedScalar working fine in the constructor of phaseModel, but not in main() ?

Last edited by maybee; April 3, 2014 at 11:25.
maybee is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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



All times are GMT -4. The time now is 07:05.