/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 Shell Research Ltd. Copyright (C) 2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM 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 3 of the License, or (at your option) any later version. OpenFOAM 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 OpenFOAM. If not, see . Class Foam::PDRarrays Description Work array definitions for PDR fields SourceFiles PDRarrays.C PDRarraysCalc.C \*---------------------------------------------------------------------------*/ #ifndef PDRarrays_H #define PDRarrays_H #include "symmTensor.H" #include "symmTensor2D.H" #include "SquareMatrix.H" #include "IjkField.H" #include // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { // Forward Declarations class PDRblock; class PDRmeshArrays; class PDRobstacle; class PDRpatchDef; /*---------------------------------------------------------------------------*\ Class PDRarrays Declaration \*---------------------------------------------------------------------------*/ class PDRarrays { //- Reference to PDRblock std::reference_wrapper pdrBlock_; public: // Data Members // Entries used for analysis and when writing fields //- Volume blockage IjkField v_block; //- Surface area in cell IjkField surf; //- Obstacle size in cell IjkField obs_size; //- Summed area blockage (directional) from sharp obstacles IjkField area_block_s; //- Summed area blockage (directional) from round obstacles IjkField area_block_r; //- A total directional blockage in the cell IjkField> dirn_block; //- Face area blockage for face, //- summed from cell centre-plane to cell centre-plane IjkField face_block; //- Longitudinal area blockage from obstacles that extend all the way //- through the cell in a given direction. IjkField along_block; IjkField betai_inv1; //- Number of obstacles in cell. // Can be non-integer if an obstacle does not pass all way through cell IjkField obs_count; //- Number of obstacles parallel to specified direction IjkField sub_count; //- Addition to count to account for grating comprises many bars //- (to get Lobs right) IjkField grating_count; //- Tensorial drag from sharp obstacles IjkField drag_s; //- Directional drag from round obstacles IjkField drag_r; // Next arrays are for 2D calculations of intersection // One-dimensional scratch areas for cell overlaps Vector> overlap_1d; // In two dimensions, area of cell covered by circle SquareMatrix aboverlap; // In two dimensions, length of perimeter of circle witthin cell SquareMatrix abperim; // For offset cells, i.e. face blockage SquareMatrix a_lblock, b_lblock; // For centred cells SquareMatrix ac_lblock, bc_lblock; // The count in the cells SquareMatrix c_count; //- Cell-centred drag SquareMatrix c_drag; //- Face field for (directional) for patch Id IjkField face_patch; //- Face field for (directional) hole in face IjkField> hole_in_face; // Constructors //- Construct null PDRarrays(); //- Construct and reset explicit PDRarrays(const PDRblock& pdrBlock); //- Destructor ~PDRarrays() = default; // Member Functions //- Reset PDRblock reference, resize and zero arrays void reset(const PDRblock& pdrBlock); //- Reference to PDRblock const PDRblock& block() const { return pdrBlock_.get(); } //- Summary of the blockages // For diagnostics and general overview void blockageSummary() const; //- Add cylinder blockage void addCylinder(const PDRobstacle& obs); //- Add general (non-cylinder) blockage void addBlockage ( const PDRobstacle& obs, DynamicList& patches, const int volumeSign ); static void calculateAndWrite ( PDRarrays& arr, const PDRmeshArrays& meshIndexing, const fileName& casepath, const UList& patches ); void calculateAndWrite ( const fileName& casepath, const PDRmeshArrays& meshIndexing, const UList& patches ); }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //