From 94d3e79a8617f88dc0219cfdeedfa3147833719d Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 24 Jun 2019 14:43:36 +0200 Subject: Initialize at openlb-1-3 --- .../advectionDiffusionBoundaryCondition2D.h | 157 +++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 src/boundary/advectionDiffusionBoundaryCondition2D.h (limited to 'src/boundary/advectionDiffusionBoundaryCondition2D.h') diff --git a/src/boundary/advectionDiffusionBoundaryCondition2D.h b/src/boundary/advectionDiffusionBoundaryCondition2D.h new file mode 100644 index 0000000..e47d9d1 --- /dev/null +++ b/src/boundary/advectionDiffusionBoundaryCondition2D.h @@ -0,0 +1,157 @@ +/* This file is part of the OpenLB library + * + * Copyright (C) 2008 Orestis Malaspinas, Andrea Parmigiani + * E-mail contact: info@openlb.net + * The most recent release of OpenLB can be downloaded at + * + * + * 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 + * A helper for initialising 2D boundaries -- header file. + */ + +#ifndef ADVECTION_DIFFUSION_BOUNDARY_CONDITION_2D_H +#define ADVECTION_DIFFUSION_BOUNDARY_CONDITION_2D_H + +#include "momentaOnBoundaries2D.h" +#include "advectionDiffusionMomentaOnBoundaries.h" +#include "dynamics/dynamics.h" +#include "dynamics/advectionDiffusionDynamics.h" +#include "functors/lattice/indicator/blockIndicatorBaseF2D.h" + +#include +#include + +namespace olb { + +template +class sOnLatticeBoundaryCondition2D; + +template +class OnLatticeAdvectionDiffusionBoundaryCondition2D { +public: + virtual ~OnLatticeAdvectionDiffusionBoundaryCondition2D() { } + + virtual void addTemperatureBoundary0N(int x0, int x1, int y0, int y1,T omega) =0; + virtual void addTemperatureBoundary0P(int x0, int x1, int y0, int y1,T omega) =0; + virtual void addTemperatureBoundary1N(int x0, int x1, int y0, int y1,T omega) =0; + virtual void addTemperatureBoundary1P(int x0, int x1, int y0, int y1,T omega) =0; + + virtual void addTemperatureCornerNN(int x, int y, T omega) =0; + virtual void addTemperatureCornerNP(int x, int y, T omega) =0; + virtual void addTemperatureCornerPN(int x, int y, T omega) =0; + virtual void addTemperatureCornerPP(int x, int y, T omega) =0; + + BlockLatticeStructure2D& getBlock(); + BlockLatticeStructure2D const& getBlock() const; + + /// Add temperature boundary for indicated cells in range + virtual void addTemperatureBoundary(BlockIndicatorF2D& indicator, + int x0, int x1, int y0, int y1, + T omega) =0; + + /** + * \name Convenience wrappers for temperature boundary functions + * \{ + **/ + + void addTemperatureBoundary(BlockGeometryStructure2D& blockGeometryStructure, int material, + int x0, int x1, int y0, int y1, + T omega); + void addTemperatureBoundary(BlockIndicatorF2D& indicator, + T omega, bool includeOuterCells=false); + void addTemperatureBoundary(BlockGeometryStructure2D& blockGeometryStructure, int material, + T omega, bool includeOuterCells=false); + + ///\} + + /// adds a temperature boundary for one material or a range (x0-x1, y0-y1, z0-z1) + virtual void addRegularizedTemperatureBoundary(BlockIndicatorF2D& indicator, int x0, int x1, int y0, int y1, T omega) =0; + virtual void addRegularizedTemperatureBoundary(BlockGeometryStructure2D& blockGeometryStructure, int material, int x0, int x1, int y0, int y1, T omega) =0; + virtual void addRegularizedTemperatureBoundary(BlockIndicatorF2D& indicator, T omega) =0; + virtual void addRegularizedTemperatureBoundary(BlockGeometryStructure2D& blockGeometryStructure, int material, T omega) =0; + + virtual void addRegularizedHeatFluxBoundary(BlockIndicatorF2D& indicator, int x0, int x1, int y0, int y1, T omega, T *heatFlux) =0; + virtual void addRegularizedHeatFluxBoundary(BlockGeometryStructure2D& blockGeometryStructure, int material, int x0, int x1, int y0, int y1, T omega, T *heatFlux) =0; + virtual void addRegularizedHeatFluxBoundary(BlockIndicatorF2D& indicator, T omega, T *heatFlux) =0; + virtual void addRegularizedHeatFluxBoundary(BlockGeometryStructure2D& blockGeometryStructure, int material, T omega, T *heatFlux) =0; +}; + +template +class AdvectionDiffusionBoundaryManager2D { +public: + template static Momenta* + getTemperatureBoundaryMomenta(); + template static Dynamics* + getTemperatureBoundaryDynamics(T omega, Momenta& momenta); + template static PostProcessorGenerator2D* + getTemperatureBoundaryProcessor(int x0, int x1, int y0, int y1); + + template static Momenta* + getTemperatureCornerMomenta(); + template static Dynamics* + getTemperatureCornerDynamics(T omega, Momenta& momenta); + template static PostProcessorGenerator2D* + getTemperatureCornerProcessor(int x, int y); + + + template static Momenta* + getRegularizedTemperatureBoundaryMomenta(); + template static Dynamics* + getRegularizedTemperatureBoundaryDynamics(T omega, Momenta& momenta); + template static PostProcessorGenerator2D* + getRegularizedTemperatureBoundaryProcessor(int x0, int x1, int y0, int y1); + + template static Momenta* + getRegularizedTemperatureCornerMomenta(); + template static Dynamics* + getRegularizedTemperatureCornerDynamics(T omega, Momenta& momenta); + template static PostProcessorGenerator2D* + getRegularizedTemperatureCornerProcessor(int x, int y); + + template static Momenta* + getRegularizedHeatFluxBoundaryMomenta(T *heatFlux); + template static Dynamics* + getRegularizedHeatFluxBoundaryDynamics(T omega, Momenta& momenta); + template static PostProcessorGenerator2D* + getRegularizedHeatFluxBoundaryProcessor(int x0, int x1, int y0, int y1); + + template static Momenta* + getRegularizedHeatFluxCornerMomenta(); + template static Dynamics* + getRegularizedHeatFluxCornerDynamics(T omega, Momenta& momenta); + template static PostProcessorGenerator2D* + getRegularizedHeatFluxCornerProcessor(int x, int y); +}; + +////// Factory function for Regularized Thermal BC + +/// blockLattice creator +template > +OnLatticeAdvectionDiffusionBoundaryCondition2D* +createAdvectionDiffusionBoundaryCondition2D(BlockLatticeStructure2D& block); + +/// superLattice creator, calls createAdvectionDiffusionBoundaryCondidtion3D from above. +template > +void createAdvectionDiffusionBoundaryCondition2D(sOnLatticeBoundaryCondition2D& sBC); + + +} //namespace olb + + +#endif -- cgit v1.2.3