Measuring porous media flow in OpenFOAM

Part of MVRC is designing a car with proper flow through the heat exchangers. To model the heat exchanger a porous media approach is used. However in OpenFOAM it is a bit difficult to directly measure that flow. The best approach found for the challenge was to add a separate stl file as a measurement surface using the faceSource function object. The code for the controlDict looks like this:

mSurf_mid_hx
{
  type            faceSource;
  functionObjectLibs ("libfieldFunctionObjects.so");
  surfaceFormat null;
  enabled         true;
  outputControl   timeStep;
  log             true;
  valueOutput     true;
  source          sampledSurface;
  sampledSurfaceDict
  {
    type        sampledTriSurfaceMesh;
    surface     mid_hx.stl;
    source      cells;
    interpolate true;
  }
  operation       weightedAverage;
  fields (U);
}

So now two questions remain: Where should these surfaces be located and do they have to be triangulated specially? With some carry over rules from KVRC there were surfaces at the cooling inlet and outlet required for a legal entry anyways so they were prime candidates. To be on the safe side for each race a surface in the center of the heat exchanger was also generated. It showed that the cooling inlet surface was very unreliable for the measurement as many cars showed recirculation zones ahead of the heat exchanger. The flow straightening characteristic of the heat exchanger made the measurements at the exit much better. But the mid surface showed to be best of all solutions.

Also it was analyzed how the stl triangulation affected results. It showed that poorly triangulated surfaces which high aspect ratio triangles were very bad. A uniform triangulation showed convergence in the results with the triangle length getting down to 10mm. The following image shows the results of a poor triangulation.

OpenFOAM Cooling Flow through porous media

The new rev3 rulebook got rid of the cooling inlet and outlet surfaces. So participants only have to supply the mid surface from now on. To reliably measure the flow a uniform triangulation of 10mm is recommended.

Posted in CFD, CFD Tricks and tagged .