I came to know that lookup table feature in groovyBC is only applicable for 1D data. e.g. Position of X axis and corresponding Temperate values can be given easily with lookup table.
For, 2D data, we need to user interpolation2DTable feature under codedMixed boundary condition. I need to provide temperature only on certain provided coordinates on heated wall patch. Means I have to provide (X Y T) data on my wall.
I have written following boundary condition after reading another post from
cfd-online.
Code:
bottom
{
type codedMixed;
refValue uniform 373.15;
refGradient uniform 0;
valueFraction uniform 0;
redirectType lookupHeatFluxBC;
codeInclude
#{
#include "interpolation2DTable.H"
#};
code
#{
// Construct interpolation2DTable
fileName fName = "$FOAM_CASE/temp.dat";
Foam::interpolation2DTable<scalar> lookupTableData(fName);
// Example lookup values
scalar lookupVal1 = 0.001;
scalar lookupVal2 = 374;
// Set variable gradient field
// Looks up as-> lookupTableData(row,col) in tableData.dat
this->refGrad() = lookupTableData(lookupVal1,lookupVal2);
#};
}
and lookup table is something like this:
Code:
(
(0.0001 ((0.0001 374) (0.0002 375)))
(0.0002 ((0.0001 378) (0.0002 376)))
)
where decimal values represents the X and Y coordinates in meters and 374 represents temperature value in Kelvin.
But, I am getting some erratic results, it is not applying the temperature spatially as I asked for, instead it is applying temperature (that too erratic) with time. What can be the issue? Where am I making mistake?