CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   pimpleFoam solver error (https://www.cfd-online.com/Forums/openfoam-solving/250698-pimplefoam-solver-error.html)

cesarjets July 4, 2023 12:41

pimpleFoam solver error
 
I've trying to run this tutorial but I keep getting this error with solver I believe:

--> FOAM FATAL IO ERROR:
wrong token type - expected string, found on line 54 the word 'fieldFunctionObjects'

not sure how to fix it? any help will be appreciated. Thanks



/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application pimpleFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 2000;

deltaT 1;

writeControl timeStep;

writeInterval 200;

purgeWrite 1;

writeFormat ascii;

writePrecision 6;

writeCompression off;

timeFormat general;

timePrecision 6;

runTimeModifiable true;

graphFormat raw;

functions
{
turbulenceFields
{
type turbulenceFields;
libs (fieldFunctionObjects);
writeControl writeTime;
fields (R nuTilda k epsilon omega L);
}

surfaces
{
type surfaces;
surfaceFormat boundaryData;
formatOptions
{
//// Optionally specify write options
//boundaryData
//{
// header true; // write as OpenFOAM object
// format binary; // write binary or ascii
// compression false; // compress after writing
//}
}
writeControl writeTime;
interpolationScheme cell;
fields
(
U
turbulenceProperties:R
turbulenceProperties:nuTilda
turbulenceProperties:L
);
surfaces
{
inlet
{
type patch;
patches (inlet);
interpolate false;
}
}
}
}


// ************************************************** *********************** //


/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2306 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
U
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0;
}

"(k|epsilon|R|nuTilda)"
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-06;
relTol 0;
}
}

PIMPLE
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
}

relaxationFactors
{
equations
{
U 0.5;
k 0.7;
epsilon 0.7;
R 0.7;
nuTilda 0.7;
}
}


// ************************************************** *********************** //

s1291 July 4, 2023 13:34

Make sure to use OpenFOAM ESI versions (e.g. v2306) . I believe you are getting this error because you are using OpenFOAM Foundation version such as v10 (even though the headers of the files imply that the case is prepared for OpenFOAM v2306).

Anyway, you can make it work for both versions by using this syntax:

Code:

turbulenceFields
{
  type turbulenceFields;
  libs ("libfieldFunctionObjects.so"); // this will work for both versions
  writeControl writeTime;
  fields (R nuTilda k epsilon omega L);
}


cesarjets July 4, 2023 13:52

Thanks for your help. I used the syntax you recommend but now I'm getting this error:


From function void Foam::DimensionedField<Type, GeoMesh>::operator=(const Foam::DimensionedField<Type, GeoMesh>&) [with Type = double; GeoMesh = Foam::volMesh]
in file /apps/easybuild/software/tinkercliffs-rome/OpenFOAM/9-foss-2021a/OpenFOAM-9/src/OpenFOAM/lnInclude/DimensionedField.C at line 535.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::DimensionedField<double, Foam::volMesh>::operator=(Foam::DimensionedField<d ouble, Foam::volMesh> const&) at ??:?
#3 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::operator==(Foam::tmp<Foam::Geometr icField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:?
#4 void Foam::functionObjects::turbulenceFields::processFi eld<double>(Foam::word const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:?
#5 Foam::functionObjects::turbulenceFields::execute() at ??:?
#6 Foam::functionObjects::timeControl::execute() at timeControlFunctionObject.C:?
#7 Foam::functionObjectList::start() at ??:?
#8 Foam::Time::run() const at ??:?
#9 ? at ??:?
#10 __libc_start_main in "/lib64/libc.so.6"
#11 ? at ??:?
Aborted (core dumped)

s1291 July 4, 2023 15:33

To increase your chance of solving the issue, please follow these guidelines:

1) Please provide details about your setup, including your case and the turbulence model you are using.

2) When sharing error messages, make sure to provide the full message and not just a portion of it.

3) To ensure readability, please use code tags in your post.

Thank you.


All times are GMT -4. The time now is 15:04.