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-2021 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("debug.level", 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 
88  const dictionary* dictptr;
89 
90  groundPatchName = "ground";
91  outerPatchName = "outer";
92 
93  if ((dictptr = dict.findDict("patchNames")) != nullptr)
94  {
95  const dictionary& d = *dictptr;
96 
97  d.readIfPresent("ground", groundPatchName);
98  d.readIfPresent("outer", outerPatchName);
99  }
100 
101  UPatchBc = "fixedValue;value uniform (0 0 0)";
102  if (dict.readIfPresent("UPatchBc", UPatchBc))
103  {
105  }
106 }
107 
108 
109 void Foam::PDRparams::read(const dictionary& dict)
110 {
111  readDefaults(dict);
112 
113  dict.readEntry("obsFileDir", obsfile_dir);
114  dict.readEntry("obsFileNames", obsfile_names);
115 
116  stringOps::inplaceExpand(obsfile_dir);
117 
118  for (auto& f : obsfile_names)
119  {
121  }
122 }
123 
124 
125 // ************************************************************************* //
Foam::PDRparams::nFacesToBlockC
int nFacesToBlockC
Definition: PDRparams.H:86
Foam::PDRparams::scale
scalar scale
Definition: PDRparams.H:136
Foam::PDRparams::empty_lobs_fac
scalar empty_lobs_fac
Definition: PDRparams.H:112
Foam::PDRparams::readDefaults
void readDefaults(const dictionary &dict)
Foam::stringOps::inplaceTrim
void inplaceTrim(std::string &s)
Definition: stringOps.C:1060
Foam::PDRparams::noIntersectN
bool noIntersectN
Definition: PDRparams.H:77
Foam::pars
Foam::PDRparams pars
Globals for program parameters (ugly hack)
Foam::PDRparams
Parameters for PDRsetFields.
Definition: PDRparams.H:51
Foam::PDRparams::two_d
bool two_d
Definition: PDRparams.H:72
Foam::PDRparams::blockedCellPoros
scalar blockedCellPoros
Definition: PDRparams.H:123
Foam::PDRparams::legacyObsSpec
bool legacyObsSpec
Definition: PDRparams.H:70
Foam::PDRparams::deluge
bool deluge
Definition: PDRparams.H:75
Foam::PDRparams::outerPatchName
word outerPatchName
Definition: PDRparams.H:65
Foam::PDRparams::cb_r
scalar cb_r
Definition: PDRparams.H:97
Foam::PDRparams::blockedFacePar
scalar blockedFacePar
Definition: PDRparams.H:126
Foam::PDRparams::cd_r
scalar cd_r
Definition: PDRparams.H:100
Foam::PDRparams::groundPatchName
word groundPatchName
Definition: PDRparams.H:62
Foam::PDRparams::read
void read(const dictionary &dict)
Foam::PDRparams::nPairsToBlockC
int nPairsToBlockC
Definition: PDRparams.H:90
Foam::PDRparams::cb_s
scalar cb_s
Definition: PDRparams.H:98
Foam::PDRparams::legacyMeshSpec
bool legacyMeshSpec
Definition: PDRparams.H:69
Foam::stringOps::inplaceExpand
void inplaceExpand(std::string &s, const HashTable< string > &mapping, const char sigil='$')
Definition: stringOps.C:724
Foam::PDRparams::ySymmetry
bool ySymmetry
Definition: PDRparams.H:74
Foam::dictionary::readEntry
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Definition: dictionaryTemplates.C:295
Foam::PDRparams::cd_s
scalar cd_s
Definition: PDRparams.H:101
Foam::PDRparams::obs_expand
scalar obs_expand
Definition: PDRparams.H:117
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::PDRparams::min_width
scalar min_width
Definition: PDRparams.H:109
Foam::PDRparams::blockedFacesWallFn
bool blockedFacesWallFn
Definition: PDRparams.H:78
Foam::PDRparams::gridPointTol
scalar gridPointTol
Definition: PDRparams.H:95
Foam::PDRparams::maxCR
scalar maxCR
Definition: PDRparams.H:129
Foam::PDRparams::yCyclic
bool yCyclic
Definition: PDRparams.H:73
Foam::PDRparams::outerCombFac
scalar outerCombFac
Definition: PDRparams.H:115
Foam::PDRparams::overlaps
int overlaps
Definition: PDRparams.H:93
Foam::PDRparams::UPatchBc
string UPatchBc
"fixedValue;value uniform (0 0 0)"
Definition: PDRparams.H:67
f
labelList f(nPoints)
Foam::PDRparams::min_overlap_vol
scalar min_overlap_vol
Definition: PDRparams.H:105
Foam::PDRparams::debugLevel
int debugLevel
Definition: PDRparams.H:82
PDRparams.H
Foam::PDRparams::new_fields
bool new_fields
Definition: PDRparams.H:76
Foam::PDRparams::ignoreGratings
bool ignoreGratings
Definition: PDRparams.H:79
Foam::PDRparams::blockageNoCT
scalar blockageNoCT
Definition: PDRparams.H:133
stringOps.H
Foam::PDRparams::min_overlap_area
scalar min_overlap_area
Definition: PDRparams.H:106
Foam::PDRparams::cong_max_betav
scalar cong_max_betav
Definition: PDRparams.H:103
Foam::PDRparams::def_grating_slat_w
scalar def_grating_slat_w
Definition: PDRparams.H:120
Foam::PDRparams::outer_orthog
bool outer_orthog
Definition: PDRparams.H:80