Calculate massflows through arbitrary planes

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Johannes Koopman

Calculate massflows through arbitrary planes

Post by Johannes Koopman »

ello

Did anyone solve the problem of calculating averaged flow quantities (for instance the mass flow) through an arbitrary crass sectional plane. This plane has to be defined by the user.

I can imagine that the repeated use of extraction of the one dimensional profiles in usproj will more or less solve this problem for cross sections perpendicular to the main directions. However this routine uses values of the nearest cells, so this must lead to somewhat inexact results.

Kind regards

Johannes Koopma
Yvan Fournier

Re: Calculate massflows through arbitrary planes

Post by Yvan Fournier »

Hello,
This needs to be easier to use in the future, but you may compute averaged flow quantities through any subset of the meshes faces (interior and exterior), so if you select faces aligned with your plane, that should be fine (and if they are not aligned, you will have interpolation and the associated loss of precision somewhere).
Look at examples in section 2 (energy balance) in usproj.f90 for an example (for an averaged quantity, just divide by the surface) to see how this may be done. You may probably simplify this, but it is a good starting point/illustration.
To select interior faces, you may replace the getfbr() call used for boundary faces by a getfac() call for interior faces (also using ifacel instead f ifabor, propfa instead of propfb, ... to adjust to interior cells). As a selection criteria, you may use the plane[] operator, described in the user documentation (search the pdf for "plane").
Best regards,
  Yvan
Post Reply