CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Comparison: volScalarField in phaseModel and within main() (https://www.cfd-online.com/Forums/openfoam-programming-development/132600-comparison-volscalarfield-phasemodel-within-main.html)

maybee April 3, 2014 06:07

Comparison: volScalarField in phaseModel and within main()
 
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() ?


All times are GMT -4. The time now is 23:08.