From 659526101af0973a3d8d77642f5135cccb1cf9f5 Mon Sep 17 00:00:00 2001 From: sergio Date: Mon, 21 Jan 2019 16:29:58 -0800 Subject: [PATCH] ENH: Adding reflection capability to solar load radiation model ENH: Several modifycations to avoid erroneuos rays to be shot from wrong faces. ENH: Updating tutorials and avoiding registration of the coarse singleCellFvMesh Adding solarLoad tutorial case simpleCarSolarPanel ENH: Changes needed for the merge --- .../laserDTRM/laserDTRM.C | 5 + .../laserDTRM/laserDTRM.H | 3 + .../triSurfaceTools/triSurfaceTools.H | 2 +- .../exact/exactPatchDistMethod.C | 5 +- .../solarLoad/faceReflecting/faceReflecting.C | 74 +- .../solarLoad/faceReflecting/faceReflecting.H | 3 + .../radiationModels/solarLoad/solarLoad.C | 40 +- .../radiationModels/solarLoad/solarLoad.H | 2 +- .../radiationModels/viewFactor/viewFactor.C | 52 +- .../boundaryRadiationPropertiesPatch.C | 5 +- .../constant/radiationProperties | 8 +- .../simpleCarSolarPanel/0.orig/T | 39 + .../simpleCarSolarPanel/0.orig/U | 40 + .../simpleCarSolarPanel/0.orig/p | 35 + .../simpleCarSolarPanel/0.orig/p_rgh | 39 + .../simpleCarSolarPanel/Allclean | 8 + .../simpleCarSolarPanel/Allrun | 15 + .../constant/boundaryRadiationProperties | 75 + .../simpleCarSolarPanel/constant/g | 21 + .../constant/radiationProperties | 97 + .../constant/thermophysicalProperties | 48 + .../constant/triSurface/simpleCar.stl | 22090 ++++++++++++++++ .../constant/turbulenceProperties | 20 + .../simpleCarSolarPanel/system/blockMeshDict | 105 + .../simpleCarSolarPanel/system/controlDict | 45 + .../simpleCarSolarPanel/system/fvSchemes | 62 + .../simpleCarSolarPanel/system/fvSolution | 64 + .../system/meshQualityDict | 24 + .../system/snappyHexMeshDict | 156 + .../system/surfaceFeatureExtractDict | 27 + .../constant/air/boundaryRadiationProperties | 7 +- .../constant/air/radiationProperties | 2 +- .../constant/floor/radiationProperties | 6 +- .../constant/solid/radiationProperties | 6 +- .../constant/bottomAir/radiationProperties | 9 +- 35 files changed, 23142 insertions(+), 97 deletions(-) create mode 100644 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/0.orig/T create mode 100644 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/0.orig/U create mode 100644 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/0.orig/p create mode 100644 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/0.orig/p_rgh create mode 100755 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/Allclean create mode 100755 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/Allrun create mode 100755 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/constant/boundaryRadiationProperties create mode 100755 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/constant/g create mode 100755 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/constant/radiationProperties create mode 100755 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/constant/thermophysicalProperties create mode 100755 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/constant/triSurface/simpleCar.stl create mode 100755 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/constant/turbulenceProperties create mode 100755 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/system/blockMeshDict create mode 100755 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/system/controlDict create mode 100755 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/system/fvSchemes create mode 100755 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/system/fvSolution create mode 100644 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/system/meshQualityDict create mode 100755 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/system/snappyHexMeshDict create mode 100755 tutorials/heatTransfer/buoyantSimpleFoam/simpleCarSolarPanel/system/surfaceFeatureExtractDict diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.C b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.C index 3a1236fa0a..fa511dcacd 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.C +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.C @@ -533,6 +533,11 @@ bool Foam::radiation::laserDTRM::read() return false; } +Foam::label Foam::radiation::laserDTRM::nBands() const +{ + return 1; +} + void Foam::radiation::laserDTRM::calculate() { diff --git a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.H b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.H index 4bdc470ade..71d78eff7d 100644 --- a/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.H +++ b/applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/laserDTRM.H @@ -250,6 +250,9 @@ public: //- Read radiation properties dictionary bool read(); + //- Number of bands for this radiation model + virtual label nBands() const; + // Access diff --git a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.H b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.H index 8788ffda7a..8e00384d11 100644 --- a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.H +++ b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2018 OpenFOAM Foundation diff --git a/src/parallel/distributed/patchDistMethods/exact/exactPatchDistMethod.C b/src/parallel/distributed/patchDistMethods/exact/exactPatchDistMethod.C index be57dc7c96..671d765b44 100644 --- a/src/parallel/distributed/patchDistMethods/exact/exactPatchDistMethod.C +++ b/src/parallel/distributed/patchDistMethods/exact/exactPatchDistMethod.C @@ -77,6 +77,8 @@ Foam::patchDistMethods::exact::patchSurface() const Info<< "Triangulating local patch faces" << nl << endl; + labelList mapTriToGlobal; + patchSurfPtr_.reset ( new distributedTriSurfaceMesh @@ -93,7 +95,8 @@ Foam::patchDistMethods::exact::patchSurface() const triSurfaceTools::triangulate ( pbm, - patchIDs_ + patchIDs_, + mapTriToGlobal ), dict ) diff --git a/src/thermophysicalModels/radiation/radiationModels/solarLoad/faceReflecting/faceReflecting.C b/src/thermophysicalModels/radiation/radiationModels/solarLoad/faceReflecting/faceReflecting.C index 0337ed9f60..b44c20b723 100644 --- a/src/thermophysicalModels/radiation/radiationModels/solarLoad/faceReflecting/faceReflecting.C +++ b/src/thermophysicalModels/radiation/radiationModels/solarLoad/faceReflecting/faceReflecting.C @@ -125,9 +125,11 @@ void Foam::faceReflecting::initialise(const dictionary& coeffs) // global face index globalIndex globalNumbering(mesh_.nFaces()); + // Collect faces with t = 0, r = 0 and a > 0 to shoot rays // and patches to construct the triSurface DynamicList dynCf; + DynamicList dynNf; DynamicList