利用codeStream设置温度边界初始场
-
各位前辈好,我想利用codeStream设置壁面的初始温度场,但是编译之后显示出错,查找相关资料没有很好的办法,希望大家可以指点一下,谢谢
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [ 0 0 0 1 0 0 0 ]; internalField uniform 300; boundaryField { INT { type fixedValue; value uniform 300; } OUT { type zeroGradient; } LONGWALL { type zeroGradient; } WALL { type codedFixedValue; 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("WALL"); const fvPatch& patch = mesh.boundary()[id]; scalarField T(patch.size(), scalar(300) ); const scalar gamma = 25e2; const scalar Tin = 300; const scalar Tout = 1400; const scalar L = 2.5e-3; forAll(T, i) { const scalar x = patch.Cf()[i][0]; const scalar y = patch.Cf()[i][1]; const scalar radial = pow(x,2)+pow(y,2); const scalar dist = sqrt(radial); if ( dist <= L ) { scalar alpha = gamma*(dist-L/2); T[i] = scalar( (Tout-Tin)/2*(exp(2.0*alpha)-1.0)/(exp(2.0*alpha)+1.0)+(Tin+Tout)/2.0 ); } else if ( dist > L ) { T[i] = scalar( Tout ); } } T.writeEntry("",os); #}; } } }
--> FOAM FATAL IO ERROR: "ill defined primitiveEntry starting at keyword 'value' on line 40 and ending at line 100" file: /home/lucas/桌面/phi0.7/0/T at line 100. From function primitiveEntry::readEntry(const dictionary&, Istream&) in file lnInclude/IOerror.C at line 132. FOAM exiting
报错信息一直显示从40到100行不正确的定义,但是我整个字典只有98行,希望大家能指点一下