带薄层的非均匀温度边界条件如何植入?
-
非均匀温度边界条件可以通过codedFixedValue轻松实现,
带壁厚的温度边界条件可以通过externalWallHeatFluxTemperture实现。
如代码所示:\\非均匀温度边界条件 wall { type codedFixedValue; name dummy; code #{ const vectorField& Cf = patch().Cf(); const scalar a0 = 0.1; forAll(Cf, faceI) { const scalar y = Cf[faceI].y(); (*this)[faceI] = a0*y; } #}; } \\薄壁温度条件 wall { type externalWallHeatFluxTemperature; mode coefficient; h uniform 1e10; Ta 1620; thicknessLayers (0.015); kappaLayers (4); kappaMethod fluidThermo; value $internalField; }
但是,当我想像下面这样编程使Ta为非均匀值时,会报错,即使我使用了codeInclude codeOptions codeLibs之后,仍会报错 ‘patch’ was not declared in this scope,似乎在externalWallHeatFluxTemperature中,无法访问到网格信息。请问各位大佬有解决办法吗?或者有没有别的办法实现带薄壁的非均匀温度边界呢?
‘vectorField’ does not name a type ‘Cf’ was not declared in this scope
Ta coded; code #{ const vectorField& Cf = patch().Cf(); const scalar a0 = 0.1; forAll(Cf, faceI) { const scalar y = Cf[faceI].y(); (*this)[faceI] = a0*y; } #};