problems coming from the new version of OpenFOAM (v7))
Dear formers,
Recently I tried to transplanted a previous programmed solver, which is run well in OpenFOAM 5.0, to the newest version, OpenFOAM v7. The following problems were encountered, 1. the class fvMesh does not have a member function solver(). So the sentence pEqn.solve(mesh.solver(p.select(piso.finalInnerIte r()))); (in the header file pEqn.H of solvers such as pisoFoam) cannot been executed. This was solved by using pEqn.solve( ); instead. 2. An executing of BC codeStream as upWall { 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("upWall"); const fvPatch& patch = mesh.boundary()[id]; scalarField potenH(patch.size(), scalar(0)); const scalar H_0 = 1.4835e3; const scalar h = 0.2e-3; forAll(potenH,i) { const scalar x = patch.Cf()[i][0]; potenH[i] = scalar(0. - H_0*h - 0.2*H_0*x); } potenH.writeEntry("", os); #}; }; } encounted the following problem Failed wmake "dynamicCode/_63e33dcbd665576f46bbc4b2803f07eb39c7605b/platforms/linux64GccDPInt32Opt/lib/libcodeStream_63e33dcbd665576f46bbc4b2803f07eb39c7 605b.so" file: /home/yw/OpenFOAM/ym-7/run/SelfProgrammedSolvers/fhdFoam/fhdTut/2_channelFlowGradientField/2H0ByFoam/0/potenH.boundaryField.upWall from line 35 to line 35. From function static void (* Foam::functionEntries::codeStream::getFunction(con st Foam::dictionary&, const Foam::dictionary&))(Foam::Ostream&, const Foam::dictionary&) in file db/dictionary/functionEntries/codeStream/codeStream.C at line 215. FOAM exiting and this problem was not solved. Does anyone has ideas? Thank you in advance. |
here is an upgrade guide from openfoam.com
openfoam.com user-upgrade-guide and release notes from openfoam.rog openfoam.org history may help. |
Dear Bestucan,
Thanks for your reminder. The problem 2 was finially addressed by replacing "potenH.writeEntry("", os)" with "writeEntry(os, "", potenH)" and it works well now. |
All times are GMT -4. The time now is 23:08. |