| 1 |
/* |
| 2 |
* Advanced Simulation Library <http://asl.org.il> |
| 3 |
* |
| 4 |
* Copyright 2015 Avtech Scientific <http://avtechscientific.com> |
| 5 |
* |
| 6 |
* |
| 7 |
* This file is part of Advanced Simulation Library (ASL). |
| 8 |
* |
| 9 |
* ASL is free software: you can redistribute it and/or modify it |
| 10 |
* under the terms of the GNU Affero General Public License as |
| 11 |
* published by the Free Software Foundation, version 3 of the License. |
| 12 |
* |
| 13 |
* ASL is distributed in the hope that it will be useful, |
| 14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
* GNU Affero General Public License for more details. |
| 17 |
* |
| 18 |
* You should have received a copy of the GNU Affero General Public License |
| 19 |
* along with ASL. If not, see <http://www.gnu.org/licenses/>. |
| 20 |
* |
| 21 |
*/ |
| 22 |
|
| 23 |
|
| 24 |
#ifndef ASLLBGKBC_H |
| 25 |
#define ASLLBGKBC_H |
| 26 |
|
| 27 |
#include "aslBCond.h" |
| 28 |
#include "acl/aclMath/aclVectorOfElementsDef.h" |
| 29 |
|
| 30 |
namespace acl{ |
| 31 |
class Kernel; |
| 32 |
typedef std::shared_ptr<acl::Kernel> SPKernel; |
| 33 |
class KernelMerger; |
| 34 |
typedef std::shared_ptr<acl::KernelMerger> SPKernelMerger; |
| 35 |
} |
| 36 |
|
| 37 |
namespace asl |
| 38 |
{ |
| 39 |
class LBGK; |
| 40 |
typedef std::shared_ptr<LBGK> SPLBGK; |
| 41 |
class PositionFunction; |
| 42 |
typedef std::shared_ptr<PositionFunction> SPPositionFunction; |
| 43 |
|
| 44 |
|
| 45 |
class BCLBGKCommon:public BCond |
| 46 |
{ |
| 47 |
protected: |
| 48 |
SPLBGK num; |
| 49 |
std::vector<acl::SPKernel> kernels; |
| 50 |
acl::SPKernelMerger km; |
| 51 |
|
| 52 |
AVec<int> directionGroupsShifts; |
| 53 |
AVec<int> directionGroupsSizes; |
| 54 |
|
| 55 |
void sortDirections(); |
| 56 |
public: |
| 57 |
BCLBGKCommon(SPLBGK nm); |
| 58 |
virtual void execute(); |
| 59 |
}; |
| 60 |
|
| 61 |
/// Bondary condition corresponding to a rigid wall (\f$ \vec u=0\f$) |
| 62 |
/** |
| 63 |
\ingroup TransportProcessesBC |
| 64 |
The class realizes simple bounce back boundary conditions |
| 65 |
\f[ \vec v =0,\; \nabla P = 0 \f] |
| 66 |
*/ |
| 67 |
class BCNoSlip: public BCLBGKCommon |
| 68 |
{ |
| 69 |
public: |
| 70 |
BCNoSlip(SPLBGK nm); |
| 71 |
virtual void init(); |
| 72 |
}; |
| 73 |
|
| 74 |
/// Bondary condition corresponding an in- or outflow boundary conditions with a given pressure |
| 75 |
/** |
| 76 |
\ingroup TransportProcessesBC |
| 77 |
\f[ \vec v =0,\; P = Const \f] |
| 78 |
*/ |
| 79 |
class BCConstantPressure: public BCLBGKCommon |
| 80 |
{ |
| 81 |
protected: |
| 82 |
acl::VectorOfElements pressure; |
| 83 |
public: |
| 84 |
BCConstantPressure(SPLBGK nm, const acl::VectorOfElements & p); |
| 85 |
virtual void init(); |
| 86 |
}; |
| 87 |
|
| 88 |
/// Bondary condition corresponding wall with given velocity for uncompressible |
| 89 |
/** |
| 90 |
\ingroup TransportProcessesBC |
| 91 |
velocity value is valid for both tagential and normal components. |
| 92 |
\f[ \vec v =\vec v_0,\; \nabla P = 0 \f] |
| 93 |
|
| 94 |
\f[ |
| 95 |
f^{ghost}_i = f^{bulk}_{\tilde i} + 2 \frac{\vec v \dot c_i}{c^2_s} |
| 96 |
\f] |
| 97 |
|
| 98 |
*/ |
| 99 |
class BCConstantVelocity: public BCLBGKCommon |
| 100 |
{ |
| 101 |
protected: |
| 102 |
acl::VectorOfElements velocity; |
| 103 |
public: |
| 104 |
BCConstantVelocity(SPLBGK nm, const acl::VectorOfElements & v); |
| 105 |
virtual void init(); |
| 106 |
}; |
| 107 |
|
| 108 |
/// Bondary condition corresponding wall with given velocity for uncompressible |
| 109 |
/** |
| 110 |
\ingroup TransportProcessesBC |
| 111 |
|
| 112 |
velocity value is valid for both tagential and normal components. |
| 113 |
\f[ \vec v =\vec v_0,\; \nabla P = P_0 \f] |
| 114 |
|
| 115 |
*/ |
| 116 |
class BCConstantPressureVelocity: public BCLBGKCommon |
| 117 |
{ |
| 118 |
protected: |
| 119 |
acl::VectorOfElements pressure; |
| 120 |
acl::VectorOfElements velocity; |
| 121 |
public: |
| 122 |
BCConstantPressureVelocity(SPLBGK nm, |
| 123 |
const acl::VectorOfElements & p, |
| 124 |
const acl::VectorOfElements & v); |
| 125 |
virtual void init(); |
| 126 |
}; |
| 127 |
|
| 128 |
/// Bondary condition corresponding to a rigid wall (\f$ \vec u=0\f$) |
| 129 |
/** |
| 130 |
\f[ \vec v =0,\; \nabla P = 0 \f] |
| 131 |
*/ |
| 132 |
|
| 133 |
class BCNoSlipMap:public BCondWithMap |
| 134 |
{ |
| 135 |
protected: |
| 136 |
std::unique_ptr<acl::Kernel> kernel; |
| 137 |
SPLBGK num; |
| 138 |
public: |
| 139 |
BCNoSlipMap(SPLBGK nm, SPAbstractDataWithGhostNodes map); |
| 140 |
~BCNoSlipMap(); |
| 141 |
virtual void execute(); |
| 142 |
virtual void init(); |
| 143 |
}; |
| 144 |
|
| 145 |
/// |
| 146 |
/** |
| 147 |
\ingroup TransportProcessesBC |
| 148 |
*/ |
| 149 |
class BCVelocityMap:public BCondWithMap |
| 150 |
{ |
| 151 |
protected: |
| 152 |
std::unique_ptr<acl::Kernel> kernel; |
| 153 |
SPLBGK num; |
| 154 |
SPPositionFunction velocity; |
| 155 |
|
| 156 |
public: |
| 157 |
BCVelocityMap(SPLBGK nm, |
| 158 |
SPPositionFunction v, |
| 159 |
SPAbstractDataWithGhostNodes map); |
| 160 |
BCVelocityMap(SPLBGK nm, |
| 161 |
SPPositionFunction v, |
| 162 |
SPAbstractDataWithGhostNodes map, |
| 163 |
SPAbstractDataWithGhostNodes computationalDomain); |
| 164 |
~BCVelocityMap(); |
| 165 |
virtual void execute(); |
| 166 |
virtual void init(); |
| 167 |
}; |
| 168 |
|
| 169 |
/** |
| 170 |
\ingroup TransportProcessesBC |
| 171 |
*/ |
| 172 |
class BCConstantPressureVelocityMap:public BCondWithMap |
| 173 |
{ |
| 174 |
protected: |
| 175 |
std::unique_ptr<acl::Kernel> kernel; |
| 176 |
SPLBGK num; |
| 177 |
acl::VectorOfElements pressure; |
| 178 |
acl::VectorOfElements velocity; |
| 179 |
public: |
| 180 |
BCConstantPressureVelocityMap(SPLBGK nm, |
| 181 |
acl::VectorOfElements p, |
| 182 |
SPAbstractDataWithGhostNodes map); |
| 183 |
BCConstantPressureVelocityMap(SPLBGK nm, |
| 184 |
acl::VectorOfElements p, |
| 185 |
acl::VectorOfElements v, |
| 186 |
SPAbstractDataWithGhostNodes map); |
| 187 |
~BCConstantPressureVelocityMap(); |
| 188 |
virtual void execute(); |
| 189 |
virtual void init(); |
| 190 |
}; |
| 191 |
|
| 192 |
/// Set outflux corresponding to transport limitation of the deposition rate |
| 193 |
/** |
| 194 |
\ingroup TransportProcessesBC |
| 195 |
|
| 196 |
\f[ J_{dep}−J_{subl}=\frac{J_{dep}−P_0\alpha}{1+\alpha F, \f] |
| 197 |
where \f$\alpha \equiv \sum_{i\in \Omega} w_i\f$, \f$ F \f$ is the limiting factor |
| 198 |
|
| 199 |
*/ |
| 200 |
class BCTransportLimitedDepositionMap:public BCondWithMap |
| 201 |
{ |
| 202 |
protected: |
| 203 |
std::unique_ptr<acl::Kernel> kernel; |
| 204 |
SPLBGK num; |
| 205 |
acl::VectorOfElements p0; |
| 206 |
acl::VectorOfElements limitingFactor; |
| 207 |
public: |
| 208 |
BCTransportLimitedDepositionMap(SPLBGK nm, |
| 209 |
acl::VectorOfElements p, |
| 210 |
acl::VectorOfElements lF, |
| 211 |
SPAbstractDataWithGhostNodes map); |
| 212 |
~BCTransportLimitedDepositionMap(); |
| 213 |
virtual void execute(); |
| 214 |
virtual void init(); |
| 215 |
}; |
| 216 |
|
| 217 |
/// Set outflux corresponding to kinetics and transport limitations of the deposition rate |
| 218 |
/** |
| 219 |
\ingroup TransportProcessesBC |
| 220 |
\f[ J_{dep}−J_{subl}=\beta\frac{\rho−\rho_0}{1+ F}, \f] |
| 221 |
where \f$\alpha \equiv \sum_{i\in \Omega} w_i\f$, \f$ F \f$ is the limiting factor |
| 222 |
|
| 223 |
*/ |
| 224 |
class BCKineticsLimitedDepositionMap:public BCondWithMap |
| 225 |
{ |
| 226 |
protected: |
| 227 |
std::unique_ptr<acl::Kernel> kernel; |
| 228 |
SPLBGK num; |
| 229 |
acl::VectorOfElements p0; |
| 230 |
acl::VectorOfElements limitingFactor; |
| 231 |
acl::VectorOfElements beta; |
| 232 |
public: |
| 233 |
BCKineticsLimitedDepositionMap(SPLBGK nm, |
| 234 |
acl::VectorOfElements p, |
| 235 |
acl::VectorOfElements lF, |
| 236 |
acl::VectorOfElements b, |
| 237 |
SPAbstractDataWithGhostNodes map); |
| 238 |
~BCKineticsLimitedDepositionMap(); |
| 239 |
virtual void execute(); |
| 240 |
virtual void init(); |
| 241 |
}; |
| 242 |
|
| 243 |
/** |
| 244 |
\ingroup TransportProcessesBC |
| 245 |
|
| 246 |
*/ |
| 247 |
class ComputeSurfaceFluxMap:public BCondWithMap |
| 248 |
{ |
| 249 |
protected: |
| 250 |
std::unique_ptr<acl::Kernel> kernel; |
| 251 |
SPLBGK num; |
| 252 |
SPDataWithGhostNodesACLData fluxField; |
| 253 |
public: |
| 254 |
ComputeSurfaceFluxMap(SPLBGK nm, |
| 255 |
SPDataWithGhostNodesACLData fF, |
| 256 |
SPAbstractDataWithGhostNodes map); |
| 257 |
~ComputeSurfaceFluxMap(); |
| 258 |
virtual void execute(); |
| 259 |
virtual void init(); |
| 260 |
}; |
| 261 |
|
| 262 |
/** |
| 263 |
\ingroup TransportProcessesBC |
| 264 |
*/ |
| 265 |
class ComputeSurfaceForceMap:public BCondWithMap |
| 266 |
{ |
| 267 |
protected: |
| 268 |
std::unique_ptr<acl::Kernel> kernel; |
| 269 |
SPLBGK num; |
| 270 |
SPDataWithGhostNodesACLData forceField; |
| 271 |
public: |
| 272 |
ComputeSurfaceForceMap(SPLBGK nm, |
| 273 |
SPDataWithGhostNodesACLData fF, |
| 274 |
SPAbstractDataWithGhostNodes map); |
| 275 |
~ComputeSurfaceForceMap(); |
| 276 |
virtual void execute(); |
| 277 |
virtual void init(); |
| 278 |
}; |
| 279 |
|
| 280 |
/// \f[ \vec v =0,\; \nabla P = 0 \f] \ingroup TransportProcessesBC |
| 281 |
SPBCond generateBCNoSlip(SPLBGK nm, const std::vector<SlicesNames> & sl); |
| 282 |
/// \f[ \vec v =\vec v_0,\; \nabla P = 0 \f] \ingroup TransportProcessesBC |
| 283 |
SPBCond generateBCConstantVelocity(SPLBGK nm, AVec<> v, const std::vector<SlicesNames> & sl); |
| 284 |
/// \f[ \vec v =0,\; P = Const \f] \ingroup TransportProcessesBC |
| 285 |
SPBCond generateBCConstantPressure(SPLBGK nm, double p, const std::vector<SlicesNames> & sl); |
| 286 |
/// \f[ \vec v =\vec v_0,\; P = P_0 \f] \ingroup TransportProcessesBC |
| 287 |
SPBCond generateBCConstantPressureVelocity(SPLBGK nm, |
| 288 |
double p, |
| 289 |
AVec<> v, |
| 290 |
const std::vector<SlicesNames> & sl); |
| 291 |
/// \f[ \vec v = 0,\; P = Const \f] \ingroup TransportProcessesBC |
| 292 |
SPNumMethod generateBCConstantPressure(SPLBGK nm, double p, SPAbstractDataWithGhostNodes map); |
| 293 |
/// \f[ \vec v =\vec v_0,\; P = P_0 \f] \ingroup TransportProcessesBC |
| 294 |
SPNumMethod generateBCConstantPressureVelocity(SPLBGK nm, |
| 295 |
double p, |
| 296 |
AVec<> v, |
| 297 |
SPAbstractDataWithGhostNodes map); |
| 298 |
/// \f[ \vec v =0,\; \nabla P = 0 \f] \ingroup TransportProcessesBC |
| 299 |
SPNumMethod generateBCNoSlip(SPLBGK nm, SPAbstractDataWithGhostNodes map); |
| 300 |
/// \f[ \vec v =0 \f] for velocity field \ingroup TransportProcessesBC |
| 301 |
SPNumMethod generateBCNoSlipVel(SPLBGK nmU, SPAbstractDataWithGhostNodes map); |
| 302 |
/// \f[ \nabla P = 0 \f] \ingroup TransportProcessesBC |
| 303 |
SPNumMethod generateBCNoSlipRho(SPLBGK nmU, SPAbstractDataWithGhostNodes map); |
| 304 |
/// \f[ \vec v =\vec v_0,\; \nabla P = 0 \f] \ingroup TransportProcessesBC |
| 305 |
SPNumMethod generateBCVelocity(SPLBGK nm, |
| 306 |
SPPositionFunction v, |
| 307 |
SPAbstractDataWithGhostNodes map); |
| 308 |
/// \f[ \vec v =\vec v_0,\; \nabla P = 0 \f] \ingroup TransportProcessesBC |
| 309 |
SPNumMethod generateBCVelocity(SPLBGK nm, |
| 310 |
SPPositionFunction v, |
| 311 |
SPAbstractDataWithGhostNodes map, |
| 312 |
SPAbstractDataWithGhostNodes computationalDomain); |
| 313 |
/// \f[ \vec v =\vec v_0,\; \nabla P = 0 \f] \ingroup TransportProcessesBC |
| 314 |
SPNumMethod generateBCVelocityVel(SPLBGK nm, |
| 315 |
SPPositionFunction v, |
| 316 |
SPAbstractDataWithGhostNodes map); |
| 317 |
/// \ingroup TransportProcessesBC |
| 318 |
SPNumMethod generateBCTransportLimitedDeposition(SPLBGK nm, |
| 319 |
double p0, |
| 320 |
double limitingFactor, |
| 321 |
SPAbstractDataWithGhostNodes map); |
| 322 |
/// \ingroup TransportProcessesBC |
| 323 |
SPNumMethod generateBCKineticsLimitedDeposition(SPLBGK nm, |
| 324 |
double beta, |
| 325 |
double p0, |
| 326 |
double limitingFactor, |
| 327 |
SPAbstractDataWithGhostNodes map); |
| 328 |
/// \ingroup TransportProcessesBC |
| 329 |
SPNumMethod generateComputeSurfaceFlux(SPLBGK nm, |
| 330 |
SPDataWithGhostNodesACLData fF, |
| 331 |
SPAbstractDataWithGhostNodes map); |
| 332 |
|
| 333 |
/// \ingroup TransportProcessesBC |
| 334 |
SPNumMethod generateComputeSurfaceForce(SPLBGK nm, |
| 335 |
SPDataWithGhostNodesACLData fF, |
| 336 |
SPAbstractDataWithGhostNodes map); |
| 337 |
|
| 338 |
} //asl |
| 339 |
|
| 340 |
#endif //ASLBGKBC_H |