openfoam/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/system/scalarTransport
Mark Olesen d2e10bca40 ENH: support exprField specification for SemiImplicitSource
- this allows more flexibility when defining the location or intensity
  of sources.

  For example,

  {
      type            scalarSemiImplicitSource;
      volumeMode      specific;
      selectionMode   all;

      sources
      {
          tracer0
          {
              explicit
              {
                  type       exprField;

                  functions<scalar>
                  {
                      square
                      {
                          type square;
                          scale 0.0025;
                          level 0.0025;
                          frequency 10;
                      }
                  }

                  expression
                  #{
                      (hypot(pos().x() + 0.025, pos().y()) < 0.01)
                    ? fn:square(time())
                    : 0
                  #};
              }
          }
      }
  }

ENH: SemiImplicitSource: handle "sources" with explicit/implicit entries

- essentially the same as injectionRateSuSp with Su/Sp,
  but potentially clearer in purpose.

ENH: add Function1 good() method to define if function can be evaluated

- for example, provides a programmatic means of avoiding the 'none'
  function
2022-05-31 13:04:39 +02:00

87 lines
1.9 KiB
C++

// -*- C++ -*-
tracer0
{
type scalarTransport;
libs (solverFunctionObjects);
log off;
resetOnStartUp false;
writeControl writeTime;
writeInterval 1;
field tracer0;
D 0.001;
fvOptions
{
source1
{
type scalarSemiImplicitSource;
volumeMode specific;
selectionMode geometric;
selection
{
cylinder
{
source cylinder;
point1 (0.050 0 -1);
point2 (0.050 0 1);
radius 0.01;
}
}
sources
{
tracer0
{
explicit constant 0.01;
}
}
}
source2
{
type scalarSemiImplicitSource;
volumeMode specific;
selectionMode all;
sources
{
tracer0
{
explicit
{
type exprField;
functions<scalar>
{
square
{
type square;
scale 0.0025;
level 0.0025;
frequency 10;
}
}
expression
#{
(hypot(pos().x() + 0.025, pos().y()) < 0.01)
? fn:square(time())
: 0
#};
}
}
}
}
}
}
// ************************************************************************* //