navierStokes.h 883 Bytes
Newer Older
Praetorius, Simon's avatar
Praetorius, Simon committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/** \file navierStokes.h */

#ifndef NAVIER_STOKES_H
#define NAVIER_STOKES_H

#include "AMDiS.h"
#include "GeometryTools.h"

struct InflowBC : AbstractFunction<double, WorldVector<double> >
{
  InflowBC(double H_=4.1, double Um_=1.5) : H(H_), Um(Um_) {}
  double operator()(const WorldVector<double> &x) const {
    return 4.0 * Um * x[1] * (H - x[1]) / sqr(H);
  }
protected:
  double H;
  double Um;
};


21
struct MinWrapper : AbstractFunction<double, WorldVector<double> >
Praetorius, Simon's avatar
Praetorius, Simon committed
22
{
23
24
  MinWrapper(AbstractFunction<double, WorldVector<double> >* dist1_, AbstractFunction<double, WorldVector<double> >* dist2_)
  : dist1(dist1_), dist2(dist2_) {}
Praetorius, Simon's avatar
Praetorius, Simon committed
25
26
27

  double operator()(const WorldVector<double>& x) const
  {
28
    return std::min((*dist1)(x), (*dist2)(x));
Praetorius, Simon's avatar
Praetorius, Simon committed
29
  }
Praetorius, Simon's avatar
Praetorius, Simon committed
30
private:
31
32
  AbstractFunction<double, WorldVector<double> >* dist1;
  AbstractFunction<double, WorldVector<double> >* dist2;
Praetorius, Simon's avatar
Praetorius, Simon committed
33
34
35
};

#endif