|
[Sponsors] |
February 16, 2023, 16:10 |
Error in codeStream @ openFoam v10
|
#1 |
New Member
Mohammad Mesgar
Join Date: Jul 2021
Posts: 13
Rep Power: 5 |
Hi
I have error in codeStream at openFoam v10 Error: error: ‘Foam::scalarField’ {aka ‘class Foam::Field<double>’} has no member named ‘writeEntry’ make: *** [/opt/openfoam10/wmake/rules/General/transform:26: Make/linux64GccDPInt32Opt/codeStreamTemplate.o] Error 1 I searched it, this error about syntax of "writeEntry()", this syntax is changed in new versions but i can't found it. please help me to solve it. Last edited by Mohammadmz; February 17, 2023 at 02:36. |
|
February 18, 2023, 03:24 |
|
#2 |
New Member
Mohammad Mesgar
Join Date: Jul 2021
Posts: 13
Rep Power: 5 |
please help me. i need it.
|
|
February 18, 2023, 07:29 |
|
#3 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 745
Rep Power: 14 |
It's difficult, my friend, to help you without more information! Please attach the codestream and then we can maybe comment?
|
|
February 19, 2023, 08:38 |
the codeStream, inlet in boundaryField
|
#4 |
New Member
Mohammad Mesgar
Join Date: Jul 2021
Posts: 13
Rep Power: 5 |
/*--------------------------------*- C++ -*----------------------------------*\
========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 10 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object alpha.water; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type fixedValue; value #codeStream { codeInclude #{ #include "fvCFD.H" #}; codeOptions #{ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude #}; codeLibs #{ -lmeshTools \ -lfiniteVolume #}; code #{ const IOdictionary& d = static_cast<const IOdictionary&> ( dict.parent().parent() ); const fvMesh& mesh = refCast<const fvMesh>(d.db()); const label id = mesh.boundary().findPatchID("inlet"); const fvPatch& patch = mesh.boundary()[id]; scalarField a(patch.size(), scalar(0)); const scalar h = 3; forAll(a, i) //equivalent to for (int i=0; patch.size()<i; i++) { const scalar z = patch.Cf()[i][2]; if(z<h) a[i] = scalar(1); } a.writeEntry("", os); #}; }; } outlet { type zeroGradient; } cylinder { type zeroGradient; } walls { type zeroGradient; } bed { type zeroGradient; } atm { type inletOutlet; inletValue uniform 0; value uniform 0; } } // ************************************************** *********************** // |
|
February 20, 2023, 04:45 |
|
#5 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 745
Rep Power: 14 |
Check your syntax: I think that the correct writeEntry method is in dictionaryTemplates.C (line 210 - you can find this by using Doxygen and seraching on the overloaded method version with the right parameters):
Code:
template<class EntryType> void Foam::writeEntry ( Ostream& os, const word& entryName, const EntryType& value ) { writeKeyword(os, entryName); writeEntry(os, value); os << token::END_STATEMENT << endl; } Code:
writeEntry(os, "", a); |
|
February 22, 2023, 02:24 |
|
#6 |
New Member
Mohammad Mesgar
Join Date: Jul 2021
Posts: 13
Rep Power: 5 |
It solved.
Thanks & Regards. |
|
Tags |
codestream, openfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Frequently Asked Questions about Installing OpenFOAM | wyldckat | OpenFOAM Installation | 3 | November 14, 2023 12:58 |
How to develop OpenFOAM with CMake and popular IDEs | cosscholar | OpenFOAM Programming & Development | 0 | March 16, 2022 16:17 |
Solvers in OpenFOAM for LES + heat transfer | arun1994 | Main CFD Forum | 1 | November 26, 2021 08:57 |
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 | cfd.direct | OpenFOAM Announcements from Other Sources | 2 | August 31, 2015 14:36 |
64bitrhel5 OF installation instructions | mirko | OpenFOAM Installation | 2 | August 12, 2008 19:07 |