summaryrefslogtreecommitdiff
path: root/src/boundary/advectionDiffusionMomentaOnBoundaries.h
blob: 7d33c0b7c4a6c49f953521c225913868c7392c1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*  This file is part of the OpenLB library
 *
 *  Copyright (C) 2006, 2007 Jonas Latt
 *  E-mail contact: info@openlb.net
 *  The most recent release of OpenLB can be downloaded at
 *  <http://www.openlb.net/>
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version 2
 *  of the License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public
 *  License along with this program; if not, write to the Free
 *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 *  Boston, MA  02110-1301, USA.
*/

/** \file
 * Implementation of boundary cell dynamics -- header file.
 */
#ifndef ADE_MOMENTA_ON_BOUNDARIES_H
#define ADE_MOMENTA_ON_BOUNDARIES_H

#include "dynamics/dynamics.h"
#include "dynamics/advectionDiffusionMomenta.h"
#include "core/util.h"
#include "core/cell.h"

namespace olb {

/// Computation of velocity momenta on a velocity boundary
template<typename T, typename DESCRIPTOR>
class AdvectionDiffusionBoundaryMomenta : virtual public AdvectionDiffusionBulkMomenta<T,DESCRIPTOR> {
public:
  virtual void computeJneq( Cell<T,DESCRIPTOR> const& cell, T jNeq[DESCRIPTOR::d] ) const =0;
};

/// Computation of velocity momenta on a velocity boundary
template<typename T, typename DESCRIPTOR, int direction, int orientation>
class RegularizedTemperatureBM : public AdvectionDiffusionBoundaryMomenta<T,DESCRIPTOR> {
public:
  /// Default Constructor: initialization to u=0, rho=1
  RegularizedTemperatureBM(const T temperature = 0.5);

  T computeRho(Cell<T,DESCRIPTOR> const& cell) const override;
  void computeJ( Cell<T,DESCRIPTOR> const& cell, T j[DESCRIPTOR::d] ) const override;
  void computeJneq( Cell<T,DESCRIPTOR> const& cell, T jNeq[DESCRIPTOR::d] ) const override;
  void defineRho(Cell<T,DESCRIPTOR>& cell, T rho) override;
  void defineRhoU (Cell<T,DESCRIPTOR>& cell, T rho, const T u[DESCRIPTOR::d]) override;
private:
  T _temperature;
};


/// Computation of velocity momenta on a velocity boundary
template<typename T, typename DESCRIPTOR, int direction, int orientation>
class RegularizedHeatFluxBM : public AdvectionDiffusionBoundaryMomenta<T,DESCRIPTOR> {
public:
  /// Default Constructor: initialization to u=0, rho=1
  RegularizedHeatFluxBM(T *heatFlux = nullptr);

  T computeRho(Cell<T,DESCRIPTOR> const& cell) const override;
  void computeJ( Cell<T,DESCRIPTOR> const& cell, T j[DESCRIPTOR::d] ) const override;
  void computeJneq( Cell<T,DESCRIPTOR> const& cell, T jNeq[DESCRIPTOR::d] ) const override;
private:
  T _heatFlux[DESCRIPTOR::d];
};


}  // namespace olb


#endif