Operator not declared in this scope

Hey, I have been trying to compile a source file in OpenFOAM which uses the C++ syntax. When I run try to compile the make file I get the error 'autoCreateK' was not declared in this scope.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
    kU_
    (
        IOobject
        (
          IOobject::groupName("kU_", U.group()),
          this->runTime_.timeName(),
          this->mesh_,
          IOobject::MUST_READ,
          IOobject::AUTO_WRITE
        ),
        k_*fk_,
        k_.boundaryField().types(),
        autoCreateK("kU",this->mesh_)
    ),
We cant see what you have in that scope nor where the 'autoCreateK' is declared.
Well of course, the issue is that autoCreateK isn't declared in the scope :)

Funny, this user had the same exact issue and also didn't show any context: https://www.cfd-online.com/Forums/openfoam-pre-processing/130745-problems-autocreatek.html

Apparently it's some OpenFOAM 2.1 backwards compatibility issue.

This is perhaps the definition needed:
https://github.com/OpenFOAM/OpenFOAM-2.1.x/blob/master/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
tmp<volScalarField> autoCreateK
(
    const word& fieldName,
    const fvMesh& mesh
)
{
    return
        autoCreateWallFunctionField
        <
            scalar,
            RASModels::kqRWallFunctionFvPatchField<scalar>
        >
        (
            fieldName,
            mesh
        );
}

Didn't dig further than that.
Hey, thanks for that.
Topic archived. No new replies allowed.