PDRparams.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2019 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "PDRparams.H"
29 #include "stringOps.H"
30 
31 // * * * * * * * * * * * * * * * * Global Data * * * * * * * * * * * * * * * //
32 
33 // Global parameter settings
35 
36 
37 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
38 
39 void Foam::PDRparams::readDefaults(const dictionary& dict)
40 {
41  dict.readIfPresent("legacyMeshSpec", legacyMeshSpec);
42  dict.readIfPresent("legacyObsSpec", legacyObsSpec);
43 
44  dict.readIfPresent("two_d", two_d);
45  dict.readIfPresent("yCyclic", yCyclic);
46  dict.readIfPresent("ySymmetry", ySymmetry);
47  dict.readIfPresent("deluge", deluge);
48 
49  dict.readIfPresent("newFields", new_fields);
50  dict.readIfPresent("noIntersectN", noIntersectN);
51 
52  dict.readIfPresent("blockedFacesWallFn", blockedFacesWallFn);
53  dict.readIfPresent("ignoreGratings", ignoreGratings);
54 
55  outer_orthog = dict.found("outer_orthog");
56 
57  dict.readIfPresent("debugLevel", debugLevel);
58  dict.readIfPresent("nFacesToBlockC", nFacesToBlockC);
59  dict.readIfPresent("nPairsToBlockC", nPairsToBlockC);
60  dict.readIfPresent("overlaps", overlaps);
61 
62  dict.readIfPresent("gridPointTol", gridPointTol);
63 
64  dict.readIfPresent("Cb_r", cb_r);
65  dict.readIfPresent("Cb_s", cb_s);
66 
67  dict.readIfPresent("Cd_r", cd_r);
68  dict.readIfPresent("Cd_s", cd_s);
69 
70  dict.readIfPresent("congRegionMaxBetav", cong_max_betav);
71 
72  dict.readIfPresent("min_overlap_vol", min_overlap_vol);
73  dict.readIfPresent("min_overlap_area", min_overlap_area);
74  dict.readIfPresent("min_width", min_width);
75  dict.readIfPresent("empty_lobs_fac", empty_lobs_fac);
76  dict.readIfPresent("outerCombFac", outerCombFac);
77  dict.readIfPresent("obs_expand", obs_expand);
78 
79  dict.readIfPresent("def_grating_slat_w", def_grating_slat_w);
80  dict.readIfPresent("blockedCellPoros", blockedCellPoros);
81  dict.readIfPresent("blockedFacePar", blockedFacePar);
82  dict.readIfPresent("maxCR", maxCR);
83 
84  dict.readIfPresent("blockageNoCT", blockageNoCT);
85  dict.readIfPresent("scale", scale);
86 
87  UPatchBc = "fixedValue;value uniform (0 0 0)";
88  if (dict.readIfPresent("UPatchBc", UPatchBc))
89  {
91  }
92 }
93 
94 
95 void Foam::PDRparams::read(const dictionary& dict)
96 {
97  readDefaults(dict);
98 
99  dict.readEntry("obsFileDir", obsfile_dir);
100  dict.readEntry("obsFileNames", obsfile_names);
101 
102  stringOps::inplaceExpand(obsfile_dir);
103 
104  for (auto& f : obsfile_names)
105  {
107  }
108 }
109 
110 
111 // ************************************************************************* //
Foam::PDRparams::nFacesToBlockC
int nFacesToBlockC
Definition: PDRparams.H:83
Foam::PDRparams::scale
scalar scale
Overall scale factor.
Definition: PDRparams.H:133
Foam::PDRparams::empty_lobs_fac
scalar empty_lobs_fac
Lobs in empty cell is this * cube root of cell volume.
Definition: PDRparams.H:109
Foam::PDRparams::readDefaults
void readDefaults(const dictionary &dict)
Set or read defaults from dictionary.
Foam::stringOps::inplaceTrim
void inplaceTrim(std::string &s)
Trim leading and trailing whitespace inplace.
Definition: stringOps.C:1069
Foam::PDRparams::noIntersectN
bool noIntersectN
Definition: PDRparams.H:74
Foam::pars
Foam::PDRparams pars
Globals for program parameters (ugly hack)
Foam::PDRparams
Parameters for PDRsetFields.
Definition: PDRparams.H:55
Foam::PDRparams::two_d
bool two_d
Definition: PDRparams.H:69
Foam::PDRparams::blockedCellPoros
scalar blockedCellPoros
Cells with porosity less than this are blocked.
Definition: PDRparams.H:120
Foam::PDRparams::legacyObsSpec
bool legacyObsSpec
Definition: PDRparams.H:67
Foam::PDRparams::deluge
bool deluge
Definition: PDRparams.H:72
Foam::PDRparams::cb_r
scalar cb_r
Definition: PDRparams.H:94
Foam::PDRparams::blockedFacePar
scalar blockedFacePar
Faces with area blockage greater than this are blocked.
Definition: PDRparams.H:123
Foam::PDRparams::cd_r
scalar cd_r
Definition: PDRparams.H:97
Foam::PDRparams::read
void read(const dictionary &dict)
Read program parameters from dictionary.
Foam::PDRparams::nPairsToBlockC
int nPairsToBlockC
Definition: PDRparams.H:87
Foam::PDRparams::cb_s
scalar cb_s
Definition: PDRparams.H:95
Foam::PDRparams::legacyMeshSpec
bool legacyMeshSpec
Definition: PDRparams.H:66
Foam::PDRparams::ySymmetry
bool ySymmetry
Definition: PDRparams.H:71
Foam::stringOps::inplaceExpand
void inplaceExpand(std::string &s, const HashTable< string, word, string::hash > &mapping, const char sigil='$')
Definition: stringOps.C:733
Foam::dictionary::readEntry
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Definition: dictionaryTemplates.C:314
Foam::PDRparams::cd_s
scalar cd_s
Definition: PDRparams.H:98
Foam::PDRparams::obs_expand
scalar obs_expand
Definition: PDRparams.H:114
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::PDRparams::min_width
scalar min_width
Ignore obstacles with second dimension (or diameter) less than this.
Definition: PDRparams.H:106
Foam::PDRparams::blockedFacesWallFn
bool blockedFacesWallFn
Definition: PDRparams.H:75
Foam::PDRparams::gridPointTol
scalar gridPointTol
Definition: PDRparams.H:92
Foam::PDRparams::maxCR
scalar maxCR
Upper limit on CR (CT also gets limited)
Definition: PDRparams.H:126
Foam::PDRparams::yCyclic
bool yCyclic
Definition: PDRparams.H:70
Foam::PDRparams::outerCombFac
scalar outerCombFac
Value for outer region.
Definition: PDRparams.H:112
Foam::PDRparams::overlaps
int overlaps
Flag to control which overlap calculations are performed.
Definition: PDRparams.H:90
Foam::PDRparams::UPatchBc
string UPatchBc
"fixedValue;value uniform (0 0 0)"
Definition: PDRparams.H:64
f
labelList f(nPoints)
Foam::PDRparams::min_overlap_vol
scalar min_overlap_vol
Definition: PDRparams.H:102
Foam::PDRparams::debugLevel
int debugLevel
Definition: PDRparams.H:79
PDRparams.H
Foam::PDRparams::new_fields
bool new_fields
Definition: PDRparams.H:73
Foam::PDRparams::ignoreGratings
bool ignoreGratings
Definition: PDRparams.H:76
Foam::PDRparams::blockageNoCT
scalar blockageNoCT
Definition: PDRparams.H:130
stringOps.H
Foam::PDRparams::min_overlap_area
scalar min_overlap_area
Definition: PDRparams.H:103
Foam::PDRparams::cong_max_betav
scalar cong_max_betav
Definition: PDRparams.H:100
Foam::PDRparams::def_grating_slat_w
scalar def_grating_slat_w
Default slat thickness grating.
Definition: PDRparams.H:117
Foam::PDRparams::outer_orthog
bool outer_orthog
Definition: PDRparams.H:77