| 144 | // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // |
| 145 | |
| 146 | bool Foam::functionObjects::wallHeatFlux::read(const dictionary& dict) |
| 147 | { |
| 148 | fvMeshFunctionObject::read(dict); |
| 149 | writeLocalObjects::read(dict); |
| 150 | |
| 151 | const polyBoundaryMesh& pbm = mesh_.boundaryMesh(); |
| 152 | |
| 153 | patchSet_ = |
| 154 | mesh_.boundaryMesh().patchSet |
| 155 | ( |
| 156 | wordReList(dict.lookupOrDefault("patches", wordReList())) |
| 157 | ); |
| 158 | |
| 159 | Info<< type() << " " << name() << ":" << nl; |
| 160 | |
| 161 | if (patchSet_.empty()) |
| 162 | { |
| 163 | forAll(pbm, patchi) |
| 164 | { |
| 165 | if (isA<wallPolyPatch>(pbm[patchi])) |
| 166 | { |
| 167 | patchSet_.insert(patchi); |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | Info<< " processing all wall patches" << nl << endl; |
| 172 | } |
| 173 | else |
| 174 | { |
| 175 | Info<< " processing wall patches: " << nl; |
| 176 | labelHashSet filteredPatchSet; |
| 177 | forAllConstIter(labelHashSet, patchSet_, iter) |
| 178 | { |
| 179 | label patchi = iter.key(); |
| 180 | if (isA<wallPolyPatch>(pbm[patchi])) |
| 181 | { |
| 182 | filteredPatchSet.insert(patchi); |
| 183 | Info<< " " << pbm[patchi].name() << endl; |
| 184 | } |
| 185 | else |
| 186 | { |
| 187 | WarningInFunction |
| 188 | << "Requested wall heat-flux on non-wall boundary " |
| 189 | << "type patch: " << pbm[patchi].name() << endl; |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | Info<< endl; |
| 194 | |
| 195 | patchSet_ = filteredPatchSet; |
| 196 | } |
| 197 | |
| 198 | return true; |
| 199 | } |
| 200 | |
| 201 | |
| 202 | bool Foam::functionObjects::wallHeatFlux::execute() |