From 08fb4d5833bbc472399617dcfb8fc2d13232ccc9 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 9 Oct 2009 19:46:08 +0200 Subject: [PATCH 01/40] avoid spurious warnings on rm log.* --- tutorials/incompressible/simpleFoam/airFoil2D/Allclean | 2 +- tutorials/multiphase/settlingFoam/ras/tank3D/Allclean | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/incompressible/simpleFoam/airFoil2D/Allclean b/tutorials/incompressible/simpleFoam/airFoil2D/Allclean index f73c44df8a..35e38c65c5 100755 --- a/tutorials/incompressible/simpleFoam/airFoil2D/Allclean +++ b/tutorials/incompressible/simpleFoam/airFoil2D/Allclean @@ -3,4 +3,4 @@ # Clean time folders only rm -rf *[1-9]* -rm log.* +rm -f log.* 2>/dev/null diff --git a/tutorials/multiphase/settlingFoam/ras/tank3D/Allclean b/tutorials/multiphase/settlingFoam/ras/tank3D/Allclean index f73c44df8a..35e38c65c5 100755 --- a/tutorials/multiphase/settlingFoam/ras/tank3D/Allclean +++ b/tutorials/multiphase/settlingFoam/ras/tank3D/Allclean @@ -3,4 +3,4 @@ # Clean time folders only rm -rf *[1-9]* -rm log.* +rm -f log.* 2>/dev/null From c57262c2a0780252f78eca21cff3fa7a51263a9d Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Sun, 18 Oct 2009 16:23:41 +0200 Subject: [PATCH 02/40] Cleanup/fixup paraview readers - remove patch/point text labels upon deletion - combined client/server plugin instead of separate .so files first experiment with adding panel decorations - directory reorganization --- .../{ => PV2Readers}/PVFoamReader/Allwmake | 0 .../PVFoamReader/PVFoamReader/CMakeLists.txt | 0 .../PVFoamReader/Make/PVFoamReader.pvsm | 0 .../PVFoamReader/Make/PVFoamReader.xml | 0 .../PVFoamReader/PVFoamReader.pvsm.in | 0 .../PVFoamReader/PVFoamReader.xml.in | 0 .../PVFoamReader/PVFoamReaderConfigure.h.in | 0 .../PVFoamReader/PVFoamReader/vtkFoamData.cxx | 0 .../PVFoamReader/PVFoamReader/vtkFoamData.h | 0 .../PVFoamReader/vtkFoamReader.cxx | 0 .../PVFoamReader/PVFoamReader/vtkFoamReader.h | 0 .../PVFoamReader/vtkPVFoamSelectTimeSet.cxx | 0 .../PVFoamReader/vtkPVFoamSelectTimeSet.h | 0 .../vtkPVFoamServerSelectTimeSet.cxx | 0 .../vtkPVFoamServerSelectTimeSet.h | 0 .../PVFoamReader/vtkFoam/Make/files | 0 .../PVFoamReader/vtkFoam/Make/options | 0 .../vtkFoam}/vtkDataArrayTemplateImplicit.txx | 0 .../PVFoamReader/vtkFoam/vtkFoam.C | 0 .../PVFoamReader/vtkFoam/vtkFoam.H | 0 .../PVFoamReader/vtkFoam/vtkFoamAddFields.H | 0 .../vtkFoam/vtkFoamAddInternalMesh.C | 0 .../PVFoamReader/vtkFoam/vtkFoamAddPatch.C | 0 .../vtkFoam/vtkFoamConvertFields.H | 0 .../vtkFoam/vtkFoamConvertPatchFaceField.H | 0 .../vtkFoam/vtkFoamConvertPatchPointField.H | 0 .../vtkFoam/vtkFoamConvertPointField.H | 0 .../vtkFoam/vtkFoamConvertVolField.H | 0 .../vtkFoam/vtkFoamInsertNextPoint.H | 0 .../{ => PV3Readers}/PV3FoamReader/Allwclean | 3 ++ .../{ => PV3Readers}/PV3FoamReader/Allwmake | 0 .../PV3FoamReader/CMakeLists.txt | 42 +++++++++++++++---- .../PV3FoamReader/PV3FoamReader.qrc | 0 .../PV3FoamReader/PV3FoamReader.xml | 0 .../PV3FoamReader/PV3FoamReader_SM.xml | 0 .../PV3FoamReader/pqPV3FoamReaderPanel.h | 34 +++++++++++++++ .../PV3FoamReader/vtkPV3FoamReader.cxx | 7 +++- .../PV3FoamReader/vtkPV3FoamReader.h | 0 .../PV3FoamReader/vtkPV3Foam/Make/files | 0 .../PV3FoamReader/vtkPV3Foam/Make/options | 0 .../vtkDataArrayTemplateImplicit.txx | 0 .../vtkPV3Foam/vtkOpenFOAMPoints.H | 0 .../PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C | 0 .../PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H | 0 .../vtkPV3Foam/vtkPV3FoamAddToSelection.H | 0 .../vtkPV3Foam/vtkPV3FoamFaceField.H | 0 .../vtkPV3Foam/vtkPV3FoamFields.C | 0 .../vtkPV3Foam/vtkPV3FoamLagrangianFields.H | 0 .../PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C | 0 .../vtkPV3Foam/vtkPV3FoamMeshLagrangian.C | 0 .../vtkPV3Foam/vtkPV3FoamMeshPatch.C | 0 .../vtkPV3Foam/vtkPV3FoamMeshSet.C | 0 .../vtkPV3Foam/vtkPV3FoamMeshVolume.C | 0 .../vtkPV3Foam/vtkPV3FoamMeshZone.C | 0 .../vtkPV3Foam/vtkPV3FoamPatchField.H | 0 .../vtkPV3Foam/vtkPV3FoamPointFields.H | 0 .../vtkPV3Foam/vtkPV3FoamUpdateInfo.C | 0 .../vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H | 0 .../vtkPV3Foam/vtkPV3FoamUtils.C | 0 .../vtkPV3Foam/vtkPV3FoamVolFields.H | 0 .../PV3blockMeshReader/Allwclean | 3 ++ .../PV3blockMeshReader/Allwmake | 0 .../PV3blockMeshReader/CMakeLists.txt | 40 ++++++++++++++---- .../PV3blockMeshReader/PV3blockMeshReader.qrc | 0 .../PV3blockMeshReader/PV3blockMeshReader.xml | 0 .../PV3blockMeshReader_SM.xml | 0 .../pqPV3blockMeshReaderPanel.h | 34 +++++++++++++++ .../vtkPV3blockMeshReader.cxx | 7 +++- .../vtkPV3blockMeshReader.h | 0 .../vtkPV3blockMesh/Make/files | 0 .../vtkPV3blockMesh/Make/options | 0 .../vtkDataArrayTemplateImplicit.txx | 0 .../vtkPV3blockMesh/vtkOpenFOAMPoints.H | 0 .../vtkPV3blockMesh/vtkPV3blockMesh.C | 8 ++++ .../vtkPV3blockMesh/vtkPV3blockMesh.H | 0 .../vtkPV3blockMesh/vtkPV3blockMeshConvert.C | 0 .../vtkPV3blockMesh/vtkPV3blockMeshUtils.C | 0 77 files changed, 161 insertions(+), 17 deletions(-) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/Allwmake (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/CMakeLists.txt (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/Make/PVFoamReader.pvsm (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/Make/PVFoamReader.xml (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/PVFoamReader.pvsm.in (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/PVFoamReader.xml.in (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/PVFoamReaderConfigure.h.in (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/vtkFoamData.cxx (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/vtkFoamData.h (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/vtkFoamReader.cxx (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/vtkFoamReader.h (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.cxx (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.h (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.cxx (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.h (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/Make/files (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/Make/options (100%) rename applications/utilities/postProcessing/graphics/{PV3FoamReader/vtkPV3Foam => PV2Readers/PVFoamReader/vtkFoam}/vtkDataArrayTemplateImplicit.txx (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoam.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoam.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamAddFields.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamAddInternalMesh.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamAddPatch.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamConvertFields.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamConvertPatchFaceField.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamConvertPatchPointField.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamConvertPointField.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamConvertVolField.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV2Readers}/PVFoamReader/vtkFoam/vtkFoamInsertNextPoint.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/Allwclean (67%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/Allwmake (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/PV3FoamReader/CMakeLists.txt (60%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/PV3FoamReader/PV3FoamReader.qrc (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/PV3FoamReader/PV3FoamReader.xml (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml (100%) create mode 100644 applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx (99%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/Make/files (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/Make/options (100%) rename applications/utilities/postProcessing/graphics/{PV3blockMeshReader/vtkPV3blockMesh => PV3Readers/PV3FoamReader/vtkPV3Foam}/vtkDataArrayTemplateImplicit.txx (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkOpenFOAMPoints.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddToSelection.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFaceField.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFields.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamLagrangianFields.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshLagrangian.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshPatch.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshSet.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshZone.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPatchField.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUtils.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3FoamReader/vtkPV3Foam/vtkPV3FoamVolFields.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/Allwclean (67%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/Allwmake (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt (60%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.qrc (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.xml (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml (100%) create mode 100644 applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.h rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx (98%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/vtkPV3blockMesh/Make/files (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/vtkPV3blockMesh/Make/options (100%) rename applications/utilities/postProcessing/graphics/{PVFoamReader/vtkFoam => PV3Readers/PV3blockMeshReader/vtkPV3blockMesh}/vtkDataArrayTemplateImplicit.txx (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C (98%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C (100%) rename applications/utilities/postProcessing/graphics/{ => PV3Readers}/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C (100%) diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/Allwmake b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/Allwmake similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/Allwmake rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/Allwmake diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/CMakeLists.txt similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/CMakeLists.txt rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/CMakeLists.txt diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/Make/PVFoamReader.pvsm b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/Make/PVFoamReader.pvsm similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/Make/PVFoamReader.pvsm rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/Make/PVFoamReader.pvsm diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/Make/PVFoamReader.xml b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/Make/PVFoamReader.xml similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/Make/PVFoamReader.xml rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/Make/PVFoamReader.xml diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/PVFoamReader.pvsm.in b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/PVFoamReader.pvsm.in similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/PVFoamReader.pvsm.in rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/PVFoamReader.pvsm.in diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/PVFoamReader.xml.in b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/PVFoamReader.xml.in similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/PVFoamReader.xml.in rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/PVFoamReader.xml.in diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/PVFoamReaderConfigure.h.in b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/PVFoamReaderConfigure.h.in similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/PVFoamReaderConfigure.h.in rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/PVFoamReaderConfigure.h.in diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkFoamData.cxx b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkFoamData.cxx similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkFoamData.cxx rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkFoamData.cxx diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkFoamData.h b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkFoamData.h similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkFoamData.h rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkFoamData.h diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkFoamReader.cxx b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkFoamReader.cxx similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkFoamReader.cxx rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkFoamReader.cxx diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkFoamReader.h b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkFoamReader.h similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkFoamReader.h rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkFoamReader.h diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.cxx b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.cxx similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.cxx rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.cxx diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.h b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.h similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.h rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkPVFoamSelectTimeSet.h diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.cxx b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.cxx similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.cxx rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.cxx diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.h b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.h similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.h rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/PVFoamReader/vtkPVFoamServerSelectTimeSet.h diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/Make/files b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/Make/files similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/Make/files rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/Make/files diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/Make/options b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/Make/options similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/Make/options rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/Make/options diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkDataArrayTemplateImplicit.txx b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkDataArrayTemplateImplicit.txx similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkDataArrayTemplateImplicit.txx rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkDataArrayTemplateImplicit.txx diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoam.C b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoam.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoam.C rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoam.C diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoam.H b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoam.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoam.H rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoam.H diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamAddFields.H b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamAddFields.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamAddFields.H rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamAddFields.H diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamAddInternalMesh.C b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamAddInternalMesh.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamAddInternalMesh.C rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamAddInternalMesh.C diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamAddPatch.C b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamAddPatch.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamAddPatch.C rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamAddPatch.C diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertFields.H b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertFields.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertFields.H rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertFields.H diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertPatchFaceField.H b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertPatchFaceField.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertPatchFaceField.H rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertPatchFaceField.H diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertPatchPointField.H b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertPatchPointField.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertPatchPointField.H rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertPatchPointField.H diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertPointField.H b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertPointField.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertPointField.H rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertPointField.H diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertVolField.H b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertVolField.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamConvertVolField.H rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamConvertVolField.H diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamInsertNextPoint.H b/applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamInsertNextPoint.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkFoamInsertNextPoint.H rename to applications/utilities/postProcessing/graphics/PV2Readers/PVFoamReader/vtkFoam/vtkFoamInsertNextPoint.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/Allwclean b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwclean similarity index 67% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/Allwclean rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwclean index 3fdbeae44c..c5f41ab9da 100755 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/Allwclean +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwclean @@ -2,6 +2,9 @@ cd ${0%/*} || exit 1 # run from this directory set -x +# deal with client/server vs combined plugins +rm -f $FOAM_LIBBIN/libPV3FoamReader* 2>/dev/null + rm -rf PV3FoamReader/Make wclean libso vtkPV3Foam diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwmake similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/Allwmake rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwmake diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt similarity index 60% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/CMakeLists.txt rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt index 670b78c33d..7702f58039 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt @@ -7,7 +7,7 @@ # the pqReader.xml file contains xml defining readers with their # file extensions and descriptions. -cmake_minimum_required(VERSION 2.4) +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) FIND_PACKAGE(ParaView REQUIRED) INCLUDE(${PARAVIEW_USE_FILE}) @@ -33,19 +33,45 @@ SET( "Single output directory for building all libraries." ) -# Build the server-side plugin + +# +# Defined combined plugin +# + +# Extend the auto-generated panel +QT4_WRAP_CPP(MOC_SRCS pqPV3FoamReaderPanel.h) + +ADD_PARAVIEW_OBJECT_PANEL(IFACES IFACE_SRCS + CLASS_NAME pqPV3FoamReaderPanel + XML_NAME PV3FoamReader # name of SourceProxy in *SM.xml + XML_GROUP sources +) + ADD_PARAVIEW_PLUGIN( PV3FoamReader_SM "1.0" SERVER_MANAGER_XML PV3FoamReader_SM.xml SERVER_MANAGER_SOURCES vtkPV3FoamReader.cxx + GUI_INTERFACES ${IFACES} + GUI_SOURCES ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS} + GUI_RESOURCE_FILES PV3FoamReader.xml ) -# Build the client-side plugin -ADD_PARAVIEW_PLUGIN( - PV3FoamReader - "1.0" - GUI_RESOURCES PV3FoamReader.qrc -) +# # +# # Define the server-side portion of the reader plugin +# # +# ADD_PARAVIEW_PLUGIN( +# PV3FoamReader_SM "1.0" +# SERVER_MANAGER_XML PV3FoamReader_SM.xml +# SERVER_MANAGER_SOURCES vtkPV3FoamReader.cxx +# ) +# # +# # Define the client-side portion of the reader plugin +# # +# ADD_PARAVIEW_PLUGIN( +# PV3FoamReader "1.0" +# GUI_RESOURCES PV3FoamReader.qrc +# ) +# TARGET_LINK_LIBRARIES( PV3FoamReader_SM diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader.qrc b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader.qrc similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader.qrc rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader.qrc diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader.xml b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader.xml similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader.xml rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader.xml diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h new file mode 100644 index 0000000000..3c97b52dfd --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h @@ -0,0 +1,34 @@ +#ifndef __pqPV3FoamReaderPanel_h +#define __pqPV3FoamReaderPanel_h + +#include "pqAutoGeneratedObjectPanel.h" +#include +#include + +// +// Custom panel for PV3FoamReader source. +// +class pqPV3FoamReaderPanel +: + public pqAutoGeneratedObjectPanel +{ + Q_OBJECT; + typedef pqAutoGeneratedObjectPanel Superclass; + +public: + pqPV3FoamReaderPanel(pqProxy *proxy, QWidget *p) + : + pqAutoGeneratedObjectPanel(proxy, p) + { + this->layout()->addWidget + ( + new QLabel("Plugin for reading OpenFOAM meshes/results", this) + ); + } + + //virtual ~pqPV3FoamReaderPanel(); + +protected: +}; + +#endif //__pqPV3FoamReaderPanel_h diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx similarity index 99% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx index 55964e9540..28b9a2bc6f 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx @@ -113,7 +113,12 @@ vtkPV3FoamReader::~vtkPV3FoamReader() { vtkDebugMacro(<<"Deconstructor"); - delete foamData_; + if (foamData_) + { + // remove patch names + updatePatchNamesView(false); + delete foamData_; + } if (FileName) { diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/files rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/options rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkDataArrayTemplateImplicit.txx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkDataArrayTemplateImplicit.txx similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkDataArrayTemplateImplicit.txx rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkDataArrayTemplateImplicit.txx diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkOpenFOAMPoints.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkOpenFOAMPoints.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkOpenFOAMPoints.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkOpenFOAMPoints.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddToSelection.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddToSelection.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddToSelection.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddToSelection.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFaceField.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFaceField.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFaceField.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFaceField.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFields.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFields.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFields.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamFields.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamLagrangianFields.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamLagrangianFields.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamLagrangianFields.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamLagrangianFields.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMesh.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshLagrangian.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshLagrangian.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshLagrangian.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshLagrangian.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshPatch.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshPatch.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshPatch.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshPatch.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshSet.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshSet.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshSet.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshSet.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshZone.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshZone.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshZone.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshZone.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPatchField.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPatchField.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPatchField.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPatchField.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUtils.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUtils.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUtils.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUtils.C diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamVolFields.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamVolFields.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamVolFields.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamVolFields.H diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/Allwclean b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwclean similarity index 67% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/Allwclean rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwclean index 30ee40ddae..d2c85df001 100755 --- a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/Allwclean +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwclean @@ -2,6 +2,9 @@ cd ${0%/*} || exit 1 # run from this directory set -x +# deal with client/server vs combined plugins +rm -f $FOAM_LIBBIN/libPV3blockMeshReader* 2>/dev/null + rm -rf PV3blockMeshReader/Make wclean libso vtkPV3blockMesh diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwmake similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/Allwmake rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwmake diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt similarity index 60% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt index fc645367f4..c5b911f615 100644 --- a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt @@ -7,7 +7,7 @@ # the pqReader.xml file contains xml defining readers with their # file extensions and descriptions. -cmake_minimum_required(VERSION 2.4) +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) FIND_PACKAGE(ParaView REQUIRED) INCLUDE(${PARAVIEW_USE_FILE}) @@ -33,19 +33,45 @@ SET( "Single output directory for building all libraries." ) -# Build the server-side plugin +# +# Define combined plugin +# +# Try to extend the auto-generated panel +QT4_WRAP_CPP(MOC_SRCS pqPV3blockMeshReaderPanel.h) + +ADD_PARAVIEW_OBJECT_PANEL(IFACES IFACE_SRCS + CLASS_NAME pqPV3blockMeshReaderPanel + XML_NAME PV3blockMeshReader # name of SourceProxy in *SM.xml + XML_GROUP sources +) + ADD_PARAVIEW_PLUGIN( PV3blockMeshReader_SM "1.0" SERVER_MANAGER_XML PV3blockMeshReader_SM.xml SERVER_MANAGER_SOURCES vtkPV3blockMeshReader.cxx + GUI_INTERFACES ${IFACES} + GUI_SOURCES ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS} + GUI_RESOURCE_FILES PV3blockMeshReader.xml ) + +# # +# # Define the server-side portion of the reader plugin +# # +# ADD_PARAVIEW_PLUGIN(PV3blockMeshReader_SM "1.0" +# SERVER_MANAGER_XML PV3blockMeshReader_SM.xml +# SERVER_MANAGER_SOURCES vtkPV3blockMeshReader.cxx +# ) +# # +# # Define the client-side portion of the reader plugin +# # +# ADD_PARAVIEW_PLUGIN( +# PV3blockMeshReader "1.0" +# GUI_RESOURCES PV3blockMeshReader.qrc +# ) + + # Build the client-side plugin -ADD_PARAVIEW_PLUGIN( - PV3blockMeshReader - "1.0" - GUI_RESOURCES PV3blockMeshReader.qrc -) TARGET_LINK_LIBRARIES( PV3blockMeshReader_SM diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.qrc b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.qrc similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.qrc rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.qrc diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.xml b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.xml similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.xml rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader.xml diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.h b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.h new file mode 100644 index 0000000000..1f3c2ba9b2 --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.h @@ -0,0 +1,34 @@ +#ifndef __pqPV3blockMeshReaderPanel_h +#define __pqPV3blockMeshReaderPanel_h + +#include "pqAutoGeneratedObjectPanel.h" +#include +#include + +// +// Custom panel for PV3blockMeshReader source. +// +class pqPV3blockMeshReaderPanel +: + public pqAutoGeneratedObjectPanel +{ + Q_OBJECT; + typedef pqAutoGeneratedObjectPanel Superclass; + +public: + pqPV3blockMeshReaderPanel(pqProxy *proxy, QWidget *p) + : + pqAutoGeneratedObjectPanel(proxy, p) + { + this->layout()->addWidget + ( + new QLabel("Plugin for reading OpenFOAM blockMesh files", this) + ); + } + + //virtual ~pqPV3blockMeshReaderPanel(); + +protected: +}; + +#endif //__pqPV3blockMeshReaderPanel_h diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx similarity index 98% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx index 451c8b5855..155fc83f57 100644 --- a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx @@ -80,7 +80,12 @@ vtkPV3blockMeshReader::~vtkPV3blockMeshReader() { vtkDebugMacro(<<"Deconstructor"); - delete foamData_; + if (foamData_) + { + // remove point numbers + updatePointNumbersView(false); + delete foamData_; + } if (FileName) { diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/Make/files rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/Make/options rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options diff --git a/applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkDataArrayTemplateImplicit.txx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkDataArrayTemplateImplicit.txx similarity index 100% rename from applications/utilities/postProcessing/graphics/PVFoamReader/vtkFoam/vtkDataArrayTemplateImplicit.txx rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkDataArrayTemplateImplicit.txx diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C similarity index 98% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C index 2dc5bc32e3..66da31d620 100644 --- a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C @@ -219,6 +219,14 @@ Foam::vtkPV3blockMesh::~vtkPV3blockMesh() Info<< " Foam::vtkPV3blockMesh::~vtkPV3blockMesh" << endl; } + // Hmm. pointNumberTextActors are not getting removed + // + forAll(pointNumberTextActorsPtrs_, pointI) + { + pointNumberTextActorsPtrs_[pointI]->Delete(); + } + pointNumberTextActorsPtrs_.clear(); + delete meshPtr_; } diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C diff --git a/applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C rename to applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C From 1ef88a2aefbec4a1fb6e0f87b9774fb199830d62 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Sun, 18 Oct 2009 17:50:41 +0200 Subject: [PATCH 03/40] blockMesh reader fix, start refactoring of PV3Readers - apply scaleFactor (eg, mm->m) in PV3 reader - this looks better when overlaying with other objects - stop segfault when paraview exits without deleting readers first --- .../graphics/PV3Readers/Allwmake | 16 + .../PV3Readers/PV3FoamReader/Allwmake | 24 +- .../PV3FoamReader/vtkPV3FoamReader.cxx | 11 + .../PV3FoamReader/vtkPV3Foam/Make/options | 6 +- .../PV3Readers/PV3blockMeshReader/Allwmake | 24 +- .../vtkPV3blockMeshReader.cxx | 10 + .../vtkPV3blockMesh/Make/options | 2 + .../vtkPV3blockMesh/vtkOpenFOAMPoints.H | 15 + .../vtkPV3blockMesh/vtkPV3blockMesh.C | 7 +- .../vtkPV3blockMesh/vtkPV3blockMeshConvert.C | 20 +- .../PV3Readers/vtkPV3Readers/Make/files | 3 + .../PV3Readers/vtkPV3Readers/Make/options | 10 + .../PV3Readers/vtkPV3Readers/vtkPV3Readers.C | 330 ++++++++++++++++++ .../PV3Readers/vtkPV3Readers/vtkPV3Readers.H | 229 ++++++++++++ src/mesh/blockMesh/blockMesh/blockMesh.C | 6 + src/mesh/blockMesh/blockMesh/blockMesh.H | 6 + 16 files changed, 687 insertions(+), 32 deletions(-) create mode 100755 applications/utilities/postProcessing/graphics/PV3Readers/Allwmake create mode 100644 applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files create mode 100644 applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/options create mode 100644 applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/vtkPV3Readers.C create mode 100644 applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/vtkPV3Readers.H diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake new file mode 100755 index 0000000000..94a47b132b --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake @@ -0,0 +1,16 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +set -x + +if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] +then + case "$ParaView_VERSION" in + 3*) + wmake libso vtkPV3Readers + PV3blockMeshReader/Allwmake + PV3FoamReader/Allwmake + ;; + esac +fi + +# ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwmake index c7a80fc7fb..ef7b571102 100755 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwmake +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/Allwmake @@ -4,18 +4,18 @@ set -x if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] then - case "$ParaView_VERSION" in - 3*) - wmake libso vtkPV3Foam - ( - cd PV3FoamReader - mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1 - cd Make/$WM_OPTIONS - cmake ../.. - make - ) - ;; - esac + case "$ParaView_VERSION" in + 3*) + wmake libso vtkPV3Foam + ( + cd PV3FoamReader + mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1 + cd Make/$WM_OPTIONS + cmake ../.. + make + ) + ;; + esac fi # ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx index 28b9a2bc6f..0b5c65dc78 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx @@ -405,9 +405,20 @@ void vtkPV3FoamReader::updatePatchNamesView(const bool show) { pqApplicationCore* appCore = pqApplicationCore::instance(); + // need to check this, since our destructor calls this + if (!appCore) + { + return; + } + // Server manager model for querying items in the server manager pqServerManagerModel* smModel = appCore->getServerManagerModel(); + if (!smModel) + { + return; + } + // Get all the pqRenderView instances QList renderViews = smModel->findItems(); diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options index 1e936c1d5d..d58afde30b 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options @@ -1,18 +1,20 @@ EXE_INC = \ + -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ -I$(ParaView_DIR)/VTK \ -I$(ParaView_INST_DIR) \ -I$(ParaView_INST_DIR)/VTK \ -I$(ParaView_INST_DIR)/VTK/Common \ -I$(ParaView_INST_DIR)/VTK/Filtering \ -I$(ParaView_INST_DIR)/VTK/Rendering \ + -I../../vtkPV3Readers/lnInclude \ -I../PV3FoamReader LIB_LIBS = \ + -lvtkPV3Readers \ + -lmeshTools \ -lfiniteVolume \ -lgenericPatchFields \ -llagrangian \ - -lmeshTools \ $(GLIBS) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwmake index 3e2c407e6e..443100d381 100755 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwmake +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/Allwmake @@ -4,18 +4,18 @@ set -x if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] then - case "$ParaView_VERSION" in - 3*) - wmake libso vtkPV3blockMesh - ( - cd PV3blockMeshReader - mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1 - cd Make/$WM_OPTIONS - cmake ../.. - make - ) - ;; - esac + case "$ParaView_VERSION" in + 3*) + wmake libso vtkPV3blockMesh + ( + cd PV3blockMeshReader + mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1 + cd Make/$WM_OPTIONS + cmake ../.. + make + ) + ;; + esac fi # ----------------------------------------------------------------- end-of-file diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx index 155fc83f57..383deeeccc 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx @@ -220,8 +220,18 @@ void vtkPV3blockMeshReader::updatePointNumbersView(const bool show) { pqApplicationCore* appCore = pqApplicationCore::instance(); + // need to check this, since our destructor calls this + if (!appCore) + { + return; + } + // Server manager model for querying items in the server manager pqServerManagerModel* smModel = appCore->getServerManagerModel(); + if (!smModel) + { + return; + } // Get all the pqRenderView instances QList renderViews = smModel->findItems(); diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options index 2e5727ba77..5d19916934 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options @@ -7,9 +7,11 @@ EXE_INC = \ -I$(ParaView_INST_DIR)/VTK/Common \ -I$(ParaView_INST_DIR)/VTK/Filtering \ -I$(ParaView_INST_DIR)/VTK/Rendering \ + -I../../vtkPV3Readers/lnInclude \ -I../PV3blockMeshReader LIB_LIBS = \ + -lvtkPV3Readers \ -lmeshTools \ -lblockMesh \ $(GLIBS) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H index b6fa0c83b0..a8ce36e144 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H @@ -44,6 +44,21 @@ inline void vtkInsertNextOpenFOAMPoint points->InsertNextPoint(p.x(), p.y(), p.z()); } +inline void vtkInsertNextOpenFOAMPoint +( + vtkPoints *points, + const Foam::point& p, + const Foam::scalar scaleFactor +) +{ + points->InsertNextPoint + ( + p.x()*scaleFactor, + p.y()*scaleFactor, + p.z()*scaleFactor + ); +} + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C index 66da31d620..91424d3b57 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C @@ -384,6 +384,7 @@ void Foam::vtkPV3blockMesh::renderPointNumbers if (show && meshPtr_) { const pointField& cornerPts = meshPtr_->blockPointField(); + const scalar scaleFactor = meshPtr_->scaleFactor(); pointNumberTextActorsPtrs_.setSize(cornerPts.size()); forAll(cornerPts, pointI) @@ -407,9 +408,9 @@ void Foam::vtkPV3blockMesh::renderPointNumbers txt->GetPositionCoordinate()->SetValue ( - cornerPts[pointI].x(), - cornerPts[pointI].y(), - cornerPts[pointI].z() + cornerPts[pointI].x()*scaleFactor, + cornerPts[pointI].y()*scaleFactor, + cornerPts[pointI].z()*scaleFactor ); // Add text to each renderer diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C index c163ba14ed..5ad588bb30 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C @@ -66,6 +66,7 @@ void Foam::vtkPV3blockMesh::convertMeshBlocks } int blockI = 0; + const scalar scaleFactor = blkMesh.scaleFactor(); for ( @@ -103,7 +104,8 @@ void Foam::vtkPV3blockMesh::convertMeshBlocks vtkInsertNextOpenFOAMPoint ( vtkpoints, - blockPoints[blockLabels[ptI]] + blockPoints[blockLabels[ptI]], + scaleFactor ); nodeIds[ptI] = ptI; @@ -159,6 +161,7 @@ void Foam::vtkPV3blockMesh::convertMeshEdges const curvedEdgeList& edges = blkMesh.edges(); int edgeI = 0; + const scalar scaleFactor = blkMesh.scaleFactor(); for ( @@ -212,7 +215,12 @@ void Foam::vtkPV3blockMesh::convertMeshEdges vtkIdType pointIds[edgePoints.size()]; forAll(edgePoints, ptI) { - vtkInsertNextOpenFOAMPoint(vtkpoints, edgePoints[ptI]); + vtkInsertNextOpenFOAMPoint + ( + vtkpoints, + edgePoints[ptI], + scaleFactor + ); pointIds[ptI] = ptI; } @@ -266,6 +274,7 @@ void Foam::vtkPV3blockMesh::convertMeshCorners label datasetNo = 0; // restart at dataset 0 const pointField& blockPoints = meshPtr_->blockPointField(); + const scalar& scaleFactor = meshPtr_->scaleFactor(); if (debug) { @@ -284,7 +293,12 @@ void Foam::vtkPV3blockMesh::convertMeshCorners vtkIdType pointId = 0; forAll(blockPoints, ptI) { - vtkInsertNextOpenFOAMPoint(vtkpoints, blockPoints[ptI]); + vtkInsertNextOpenFOAMPoint + ( + vtkpoints, + blockPoints[ptI], + scaleFactor + ); vtkcells->InsertNextCell(1, &pointId); pointId++; diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files new file mode 100644 index 0000000000..134b8de963 --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files @@ -0,0 +1,3 @@ +vtkPV3Readers.C + +LIB = $(FOAM_LIBBIN)/libvtkPV3Readers diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/options new file mode 100644 index 0000000000..876a3e334e --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/options @@ -0,0 +1,10 @@ +EXE_INC = \ + -I$(ParaView_DIR)/VTK \ + -I$(ParaView_INST_DIR) \ + -I$(ParaView_INST_DIR)/VTK \ + -I$(ParaView_INST_DIR)/VTK/Common \ + -I$(ParaView_INST_DIR)/VTK/Filtering \ + -I$(ParaView_INST_DIR)/VTK/Rendering + +LIB_LIBS = \ + $(GLIBS) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/vtkPV3Readers.C b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/vtkPV3Readers.C new file mode 100644 index 0000000000..ed10463f91 --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/vtkPV3Readers.C @@ -0,0 +1,330 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + Misc helper methods and utilities + +\*---------------------------------------------------------------------------*/ + +#include "vtkPV3Readers.H" + +// Foam includes +#include "IFstream.H" + +// VTK includes +#include "vtkDataArraySelection.h" +#include "vtkDataSet.h" +#include "vtkMultiBlockDataSet.h" +#include "vtkInformation.h" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Foam::vtkPV3Readers, 0); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + //! @cond fileScope + // Extract up to the first non-word characters + inline word getFirstWord(const char* str) + { + if (str) + { + label n = 0; + while (str[n] && word::valid(str[n])) + { + ++n; + } + return word(str, n, true); + } + else + { + return word::null; + } + + } + //! @endcond fileScope + +} // End namespace Foam + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::vtkPV3Readers::AddToBlock +( + vtkMultiBlockDataSet* output, + vtkDataSet* dataset, + const partInfo& selector, + const label datasetNo, + const std::string& datasetName +) +{ + const int blockNo = selector.block(); + + vtkDataObject* blockDO = output->GetBlock(blockNo); + vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO); + + if (!block) + { + if (blockDO) + { + FatalErrorIn("Foam::vtkPV3Readers::AddToBlock") + << "Block already has a vtkDataSet assigned to it" + << endl; + return; + } + + block = vtkMultiBlockDataSet::New(); + output->SetBlock(blockNo, block); + block->Delete(); + } + + if (debug) + { + Info<< "block[" << blockNo << "] has " + << block->GetNumberOfBlocks() + << " datasets prior to adding set " << datasetNo + << " with name: " << datasetName << endl; + } + + block->SetBlock(datasetNo, dataset); + + // name the block when assigning dataset 0 + if (datasetNo == 0) + { + output->GetMetaData(blockNo)->Set + ( + vtkCompositeDataSet::NAME(), + selector.name() + ); + } + + if (datasetName.size()) + { + block->GetMetaData(datasetNo)->Set + ( + vtkCompositeDataSet::NAME(), + datasetName.c_str() + ); + } +} + + +vtkDataSet* Foam::vtkPV3Readers::GetDataSetFromBlock +( + vtkMultiBlockDataSet* output, + const partInfo& selector, + const label datasetNo +) +{ + const int blockNo = selector.block(); + + vtkDataObject* blockDO = output->GetBlock(blockNo); + vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO); + + if (block) + { + return vtkDataSet::SafeDownCast(block->GetBlock(datasetNo)); + } + + return 0; +} + + +// ununsed at the moment +Foam::label Foam::vtkPV3Readers::GetNumberOfDataSets +( + vtkMultiBlockDataSet* output, + const partInfo& selector +) +{ + const int blockNo = selector.block(); + + vtkDataObject* blockDO = output->GetBlock(blockNo); + vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO); + if (block) + { + return block->GetNumberOfBlocks(); + } + + return 0; +} + + +// Foam::word Foam::vtkPV3Readers::getPartName(int partId) +// { +// return getFirstWord(reader_->GetPartArrayName(partId)); +// } + + +Foam::wordHashSet Foam::vtkPV3Readers::getSelected +( + vtkDataArraySelection* select +) +{ + int nElem = select->GetNumberOfArrays(); + wordHashSet selections(2*nElem); + + for (int elemI=0; elemI < nElem; ++elemI) + { + if (select->GetArraySetting(elemI)) + { + selections.insert(getFirstWord(select->GetArrayName(elemI))); + } + } + + return selections; +} + + +Foam::wordHashSet Foam::vtkPV3Readers::getSelected +( + vtkDataArraySelection* select, + const partInfo& selector +) +{ + int nElem = select->GetNumberOfArrays(); + wordHashSet selections(2*nElem); + + for (int elemI = selector.start(); elemI < selector.end(); ++elemI) + { + if (select->GetArraySetting(elemI)) + { + selections.insert(getFirstWord(select->GetArrayName(elemI))); + } + } + + return selections; +} + + +Foam::stringList Foam::vtkPV3Readers::getSelectedArrayEntries +( + vtkDataArraySelection* select +) +{ + stringList selections(select->GetNumberOfArrays()); + label nElem = 0; + + forAll(selections, elemI) + { + if (select->GetArraySetting(elemI)) + { + selections[nElem++] = select->GetArrayName(elemI); + } + } + selections.setSize(nElem); + + + if (debug) + { + label nElem = select->GetNumberOfArrays(); + Info<< "available("; + for (int elemI = 0; elemI < nElem; ++elemI) + { + Info<< " \"" << select->GetArrayName(elemI) << "\""; + } + Info<< " )\nselected("; + + forAll(selections, elemI) + { + Info<< " " << selections[elemI]; + } + Info<< " )\n"; + } + + return selections; +} + + +Foam::stringList Foam::vtkPV3Readers::getSelectedArrayEntries +( + vtkDataArraySelection* select, + const partInfo& selector +) +{ + stringList selections(selector.size()); + label nElem = 0; + + for (int elemI = selector.start(); elemI < selector.end(); ++elemI) + { + if (select->GetArraySetting(elemI)) + { + selections[nElem++] = select->GetArrayName(elemI); + } + } + selections.setSize(nElem); + + + if (debug) + { + Info<< "available("; + for (int elemI = selector.start(); elemI < selector.end(); ++elemI) + { + Info<< " \"" << select->GetArrayName(elemI) << "\""; + } + Info<< " )\nselected("; + + forAll(selections, elemI) + { + Info<< " " << selections[elemI]; + } + Info<< " )\n"; + } + + return selections; +} + + +void Foam::vtkPV3Readers::setSelectedArrayEntries +( + vtkDataArraySelection* select, + const stringList& selections +) +{ + const int nElem = select->GetNumberOfArrays(); + select->DisableAllArrays(); + + // Loop through entries, setting values from selectedEntries + for (int elemI=0; elemI < nElem; ++elemI) + { + string arrayName(select->GetArrayName(elemI)); + + forAll(selections, elemI) + { + if (selections[elemI] == arrayName) + { + select->EnableArray(arrayName.c_str()); + break; + } + } + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + + +// ************************************************************************* // diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/vtkPV3Readers.H b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/vtkPV3Readers.H new file mode 100644 index 0000000000..fba4da5d94 --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/vtkPV3Readers.H @@ -0,0 +1,229 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Namespace + Foam::vtkPV3Readers + +Description + A collection of helper functions when building a reader interface in + ParaView3. + +SourceFiles + vtkPV3Readers.C + +\*---------------------------------------------------------------------------*/ + +#ifndef vtkPV3Readers_H +#define vtkPV3Readers_H + +// do not include legacy strstream headers +#ifndef VTK_EXCLUDE_STRSTREAM_HEADERS +# define VTK_EXCLUDE_STRSTREAM_HEADERS +#endif + +#include "className.H" +#include "fileName.H" +#include "stringList.H" +#include "wordList.H" +#include "HashSet.H" + + +// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * // + +class vtkDataArraySelection; +class vtkDataSet; +class vtkPoints; +class vtkPV3FoamReader; +class vtkRenderer; +class vtkTextActor; +class vtkMultiBlockDataSet; +class vtkPolyData; +class vtkUnstructuredGrid; +class vtkIndent; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace vtkPV3Readers +{ + //- Declare name of the class and its debug switch + NamespaceName("vtkPV3Readers"); + + //- Bookkeeping for GUI checklists and the multi-block organization + class partInfo + { + const char *name_; + int block_; + int start_; + int size_; + + public: + + partInfo(const char *name, const int blockNo=0) + : + name_(name), + block_(blockNo), + start_(-1), + size_(0) + {} + + //- Return the block holding these datasets + int block() const + { + return block_; + } + + //- Assign block number, return previous value + int block(int blockNo) + { + int prev = block_; + block_ = blockNo; + return prev; + } + + const char* name() const + { + return name_; + } + + int start() const + { + return start_; + } + + int end() const + { + return start_ + size_; + } + + int size() const + { + return size_; + } + + bool empty() const + { + return !size_; + } + + void reset() + { + start_ = -1; + size_ = 0; + } + + //- Assign new start and reset the size + void operator=(const int i) + { + start_ = i; + size_ = 0; + } + + //- Increment the size + void operator+=(const int n) + { + size_ += n; + } + }; + + + //- Convenience method use to convert the readers from VTK 5 + // multiblock API to the current composite data infrastructure + void AddToBlock + ( + vtkMultiBlockDataSet* output, + vtkDataSet* dataset, + const partInfo& selector, + const label datasetNo, + const std::string& datasetName + ); + + + //- Convenience method use to convert the readers from VTK 5 + // multiblock API to the current composite data infrastructure + vtkDataSet* GetDataSetFromBlock + ( + vtkMultiBlockDataSet* output, + const partInfo& selector, + const label datasetNo + ); + + //- Convenience method use to convert the readers from VTK 5 + // multiblock API to the current composite data infrastructure + // ununsed at the moment + label GetNumberOfDataSets + ( + vtkMultiBlockDataSet* output, + const partInfo& selector + ); + + + //- Retrieve the current selections as a wordHashSet + wordHashSet getSelected + ( + vtkDataArraySelection* select + ); + + + //- Retrieve a sub-list of the current selections + wordHashSet getSelected + ( + vtkDataArraySelection*, + const partInfo& + ); + + + //- Retrieve the current selections + stringList getSelectedArrayEntries(vtkDataArraySelection*); + + //- Retrieve a sub-list of the current selections + stringList getSelectedArrayEntries + ( + vtkDataArraySelection* select, + const partInfo& selector + ); + + + //- Set selection(s) + void setSelectedArrayEntries + ( + vtkDataArraySelection*, + const stringList& + ); + + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace vtkPV3 + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/mesh/blockMesh/blockMesh/blockMesh.C b/src/mesh/blockMesh/blockMesh/blockMesh.C index 4d499ea943..1ed0d44a7e 100644 --- a/src/mesh/blockMesh/blockMesh/blockMesh.C +++ b/src/mesh/blockMesh/blockMesh/blockMesh.C @@ -78,6 +78,12 @@ const Foam::polyMesh& Foam::blockMesh::topology() const } +Foam::scalar Foam::blockMesh::scaleFactor() const +{ + return scaleFactor_; +} + + const Foam::pointField& Foam::blockMesh::points() const { if (points_.empty()) diff --git a/src/mesh/blockMesh/blockMesh/blockMesh.H b/src/mesh/blockMesh/blockMesh/blockMesh.H index 6e67506a79..0c423a9b83 100644 --- a/src/mesh/blockMesh/blockMesh/blockMesh.H +++ b/src/mesh/blockMesh/blockMesh/blockMesh.H @@ -144,6 +144,7 @@ public: // Access //- Reference to point field defining the block mesh + // these points have not been scaled by scaleFactor const pointField& blockPointField() const; const polyMesh& topology() const; @@ -153,6 +154,11 @@ public: return edges_; } + //- The scaling factor used to convert to meters + scalar scaleFactor() const; + + //- The points for the entire mesh + // these points have been scaled by scaleFactor const pointField& points() const; const cellShapeList& cells() const; From 83cee1cb68ec0391402bf540719ca116c20ec170 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 23 Oct 2009 00:33:42 +0200 Subject: [PATCH 04/40] First useful Qt modifications to the PV3blockMeshReader, PV3FoamReader - Show Point Numbers as is_internal="1" and hook directly into a QT-checkbox and thus bypass modifying the reader state. - Same for Cache Mesh and Show Patch Names --- .../PV3FoamReader/CMakeLists.txt | 5 +- .../PV3FoamReader/PV3FoamReader_SM.xml | 42 +++--- .../PV3FoamReader/pqPV3FoamReaderPanel.cxx | 126 ++++++++++++++++++ .../PV3FoamReader/pqPV3FoamReaderPanel.h | 102 +++++++++++--- .../PV3FoamReader/vtkPV3FoamReader.cxx | 58 ++++++-- .../PV3FoamReader/vtkPV3FoamReader.h | 82 ++++++++---- .../PV3blockMeshReader/CMakeLists.txt | 7 +- .../PV3blockMeshReader_SM.xml | 11 +- .../pqPV3blockMeshReaderPanel.cxx | 100 ++++++++++++++ .../pqPV3blockMeshReaderPanel.h | 98 +++++++++++--- .../vtkPV3blockMeshReader.cxx | 60 +++++++-- .../vtkPV3blockMeshReader.h | 77 +++++++---- .../vtkPV3blockMesh/vtkOpenFOAMPoints.H | 2 +- .../vtkPV3blockMesh/vtkPV3blockMesh.C | 2 +- .../vtkPV3blockMesh/vtkPV3blockMesh.H | 2 +- .../vtkPV3blockMesh/vtkPV3blockMeshConvert.C | 2 +- .../vtkPV3blockMesh/vtkPV3blockMeshUtils.C | 2 +- 17 files changed, 629 insertions(+), 149 deletions(-) create mode 100644 applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.cxx create mode 100644 applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.cxx diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt index 7702f58039..ea50923e6a 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt @@ -43,7 +43,7 @@ QT4_WRAP_CPP(MOC_SRCS pqPV3FoamReaderPanel.h) ADD_PARAVIEW_OBJECT_PANEL(IFACES IFACE_SRCS CLASS_NAME pqPV3FoamReaderPanel - XML_NAME PV3FoamReader # name of SourceProxy in *SM.xml + XML_NAME PV3FoamReader # name of SourceProxy in *SM.xml XML_GROUP sources ) @@ -52,7 +52,8 @@ ADD_PARAVIEW_PLUGIN( SERVER_MANAGER_XML PV3FoamReader_SM.xml SERVER_MANAGER_SOURCES vtkPV3FoamReader.cxx GUI_INTERFACES ${IFACES} - GUI_SOURCES ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS} + GUI_SOURCES pqPV3FoamReaderPanel.cxx + ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS} GUI_RESOURCE_FILES PV3FoamReader.xml ) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml index a78bceb7d5..8506772e5c 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/PV3FoamReader_SM.xml @@ -16,6 +16,21 @@ + + + + + Cache the fvMesh in memory. + + + + @@ -83,21 +99,7 @@ - - - - - Cache the fvMesh in memory. - - - - - + + + + + + + + + diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.cxx new file mode 100644 index 0000000000..cfede9002c --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.cxx @@ -0,0 +1,126 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "pqPV3FoamReaderPanel.h" + +// QT +#include +#include +#include +#include +#include +#include + +// Paraview<->QT UI +#include "pqAnimationScene.h" +#include "pqApplicationCore.h" +#include "pqPipelineRepresentation.h" +#include "pqServerManagerModel.h" + +// Paraview Server Manager +#include "vtkSMDoubleVectorProperty.h" +#include "vtkSMIntVectorProperty.h" +#include "vtkSMProperty.h" +#include "vtkSMSourceProxy.h" + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +pqPV3FoamReaderPanel::pqPV3FoamReaderPanel +( + pqProxy *proxy, + QWidget *p +) +: + pqAutoGeneratedObjectPanel(proxy, p), + sourceProxy_(vtkSMSourceProxy::SafeDownCast(this->proxy())) +{ + // create first sublayout (at top of the panel) + QGridLayout *sect1 = new QGridLayout(); + this->PanelLayout->addLayout(sect1, 0, 0, 1, -1); + + + // checkbox for caching mesh + CacheMesh_ = new QCheckBox("Cache Mesh"); + CacheMesh_->setChecked(true); + + // checkbox for caching mesh + ShowPatchNames_ = new QCheckBox("Show Patch Names"); + ShowPatchNames_->setChecked(false); + + connect + ( + CacheMesh_, + SIGNAL(stateChanged(int)), + this, + SLOT(CacheMeshToggled()) + ); + + connect + ( + ShowPatchNames_, + SIGNAL(stateChanged(int)), + this, + SLOT(ShowPatchNamesToggled()) + ); + + sect1->addWidget(CacheMesh_); + sect1->addWidget(ShowPatchNames_); + + + // immediate update on the Server Manager side + vtkSMIntVectorProperty::SafeDownCast + ( + sourceProxy_->GetProperty("UiCacheMesh") + )->SetImmediateUpdate(true); + vtkSMIntVectorProperty::SafeDownCast + ( + sourceProxy_->GetProperty("UiShowPatchNames") + )->SetImmediateUpdate(true); +} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void pqPV3FoamReaderPanel::CacheMeshToggled() +{ + vtkSMIntVectorProperty::SafeDownCast + ( + sourceProxy_->GetProperty("UiCacheMesh") + )->SetElement(0, CacheMesh_->isChecked()); +} + + +void pqPV3FoamReaderPanel::ShowPatchNamesToggled() +{ + vtkSMIntVectorProperty::SafeDownCast + ( + sourceProxy_->GetProperty("UiShowPatchNames") + )->SetElement(0, ShowPatchNames_->isChecked()); +} + + +// ************************************************************************* // diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h index 3c97b52dfd..fc4f5f9ada 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/pqPV3FoamReaderPanel.h @@ -1,34 +1,98 @@ -#ifndef __pqPV3FoamReaderPanel_h -#define __pqPV3FoamReaderPanel_h +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + pqPV3FoamReaderPanel + +Description + GUI modifications for the ParaView reader panel + + A custom panel for the PV3FoamReader. + +SourceFiles + pqPV3FoamReaderPanel.cxx + +\*---------------------------------------------------------------------------*/ +#ifndef pqPV3FoamReaderPanel_h +#define pqPV3FoamReaderPanel_h #include "pqAutoGeneratedObjectPanel.h" -#include -#include -// -// Custom panel for PV3FoamReader source. -// +// Forward declaration of QT classes + +class QCheckBox; +class QLineEdit; +class QTimer; +class QToolButton; + +// Forward declaration of ParaView classes +class vtkSMSourceProxy; + + +/*---------------------------------------------------------------------------*\ + Class pqPV3FoamReaderPanel Declaration +\*---------------------------------------------------------------------------*/ + class pqPV3FoamReaderPanel : public pqAutoGeneratedObjectPanel { + // Private data Q_OBJECT; typedef pqAutoGeneratedObjectPanel Superclass; + //- Server Manager Source Proxy + vtkSMSourceProxy* sourceProxy_; + + //- CacheMesh checkbox + QCheckBox* CacheMesh_; + + //- Show Patch Names checkbox + QCheckBox* ShowPatchNames_; + +protected slots: + + void CacheMeshToggled(); + void ShowPatchNamesToggled(); + + public: - pqPV3FoamReaderPanel(pqProxy *proxy, QWidget *p) - : - pqAutoGeneratedObjectPanel(proxy, p) - { - this->layout()->addWidget - ( - new QLabel("Plugin for reading OpenFOAM meshes/results", this) - ); - } - //virtual ~pqPV3FoamReaderPanel(); + // Constructors + + //- Construct from components + pqPV3FoamReaderPanel(pqProxy*, QWidget*); + + + //- Destructor + // virtual ~pqPV3FoamReaderPanel(); -protected: }; -#endif //__pqPV3FoamReaderPanel_h + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx index 0b5c65dc78..32b01eb795 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx @@ -1,18 +1,28 @@ -/*========================================================================= +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. - Program: Visualization Toolkit - Module: $RCSfile: vtkPV3FoamReader.cxx,v $ + 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 2 of the License, or (at your + option) any later version. - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + 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. - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +\*---------------------------------------------------------------------------*/ #include "vtkPV3FoamReader.h" #include "pqApplicationCore.h" @@ -33,10 +43,15 @@ // Foam includes #include "vtkPV3Foam.H" +#undef EXPERIMENTAL_TIME_CACHING + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + vtkCxxRevisionMacro(vtkPV3FoamReader, "$Revision: 1.5$"); vtkStandardNewMacro(vtkPV3FoamReader); -#undef EXPERIMENTAL_TIME_CACHING + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // vtkPV3FoamReader::vtkPV3FoamReader() { @@ -109,6 +124,8 @@ vtkPV3FoamReader::vtkPV3FoamReader() } +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + vtkPV3FoamReader::~vtkPV3FoamReader() { vtkDebugMacro(<<"Deconstructor"); @@ -145,6 +162,8 @@ vtkPV3FoamReader::~vtkPV3FoamReader() } +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + // Do everything except set the output info int vtkPV3FoamReader::RequestInformation ( @@ -401,6 +420,17 @@ int vtkPV3FoamReader::RequestData } +void vtkPV3FoamReader::SetShowPatchNames(const int val) +{ + if (ShowPatchNames != val) + { + ShowPatchNames = val; + updatePatchNamesView(ShowPatchNames); + } +} + + + void vtkPV3FoamReader::updatePatchNamesView(const bool show) { pqApplicationCore* appCore = pqApplicationCore::instance(); @@ -414,7 +444,7 @@ void vtkPV3FoamReader::updatePatchNamesView(const bool show) // Server manager model for querying items in the server manager pqServerManagerModel* smModel = appCore->getServerManagerModel(); - if (!smModel) + if (!smModel || !foamData_) { return; } @@ -430,6 +460,8 @@ void vtkPV3FoamReader::updatePatchNamesView(const bool show) show ); } + + // use refresh here? } diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h index 4a6eb3723e..df73979205 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h @@ -1,25 +1,52 @@ -/*========================================================================= +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. - Program: Visualization Toolkit - Module: $RCSfile: vtkPV3FoamReader.h,v $ + 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 2 of the License, or (at your + option) any later version. - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + 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. - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================*/ -// .NAME vtkPV3FoamReader - reads a dataset in OpenFOAM format -// .SECTION Description -// vtkPV3FoamReader creates an multiblock dataset. -// It uses the OpenFOAM infrastructure (fvMesh, etc) to -// handle mesh and field data. +Class + vtkPV3FoamReader -#ifndef __vtkPV3FoamReader_h -#define __vtkPV3FoamReader_h +Description + reads a dataset in OpenFOAM format + + vtkPV3blockMeshReader creates an multiblock dataset. + It uses the OpenFOAM infrastructure (fvMesh, etc) to handle mesh and + field data. + +SourceFiles + vtkPV3blockMeshReader.cxx + +\*---------------------------------------------------------------------------*/ +#ifndef vtkPV3FoamReader_h +#define vtkPV3FoamReader_h + +// VTK includes +#include "vtkMultiBlockDataSetAlgorithm.h" + +// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * // + +// VTK forward declarations +class vtkDataArraySelection; +class vtkCallbackCommand; // Foam forward declarations namespace Foam @@ -27,13 +54,10 @@ namespace Foam class vtkPV3Foam; } -// VTK includes -#include "vtkMultiBlockDataSetAlgorithm.h" - -// VTK forward declarations -class vtkDataArraySelection; -class vtkCallbackCommand; +/*---------------------------------------------------------------------------*\ + Class vtkPV3FoamReader Declaration +\*---------------------------------------------------------------------------*/ class VTK_IO_EXPORT vtkPV3FoamReader : @@ -54,16 +78,16 @@ public: vtkSetStringMacro(FileName); vtkGetStringMacro(FileName); - // Description: - // GUI update control - vtkSetMacro(UpdateGUI, int); - vtkGetMacro(UpdateGUI, int); - // Description: // FOAM mesh caching control vtkSetMacro(CacheMesh, int); vtkGetMacro(CacheMesh, int); + // Description: + // GUI update control + vtkSetMacro(UpdateGUI, int); + vtkGetMacro(UpdateGUI, int); + // Description: // FOAM extrapolate internal values onto the patches vtkSetMacro(ExtrapolatePatches, int); @@ -80,7 +104,7 @@ public: // Description: // FOAM display patch names control - vtkSetMacro(ShowPatchNames, int); + virtual void SetShowPatchNames(int); vtkGetMacro(ShowPatchNames, int); // Description: diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt index c5b911f615..3376fa0d91 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt @@ -41,16 +41,17 @@ QT4_WRAP_CPP(MOC_SRCS pqPV3blockMeshReaderPanel.h) ADD_PARAVIEW_OBJECT_PANEL(IFACES IFACE_SRCS CLASS_NAME pqPV3blockMeshReaderPanel - XML_NAME PV3blockMeshReader # name of SourceProxy in *SM.xml + XML_NAME PV3blockMeshReader # name of SourceProxy in *SM.xml XML_GROUP sources ) ADD_PARAVIEW_PLUGIN( PV3blockMeshReader_SM "1.0" SERVER_MANAGER_XML PV3blockMeshReader_SM.xml - SERVER_MANAGER_SOURCES vtkPV3blockMeshReader.cxx + SERVER_MANAGER_SOURCES vtkPV3blockMeshReader.cxx GUI_INTERFACES ${IFACES} - GUI_SOURCES ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS} + GUI_SOURCES pqPV3blockMeshReaderPanel.cxx + ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS} GUI_RESOURCE_FILES PV3blockMeshReader.xml ) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml index 5eea03fe2b..2ac4774ff0 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/PV3blockMeshReader_SM.xml @@ -16,14 +16,13 @@ - - @@ -44,7 +43,6 @@ - @@ -93,6 +91,11 @@ + + + + + diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.cxx new file mode 100644 index 0000000000..45bdb661fc --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.cxx @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "pqPV3blockMeshReaderPanel.h" + +// QT +#include +#include +#include +#include +#include +#include + +// Paraview<->QT UI +#include "pqAnimationScene.h" +#include "pqApplicationCore.h" +#include "pqPipelineRepresentation.h" +#include "pqServerManagerModel.h" + +// Paraview Server Manager +#include "vtkSMDoubleVectorProperty.h" +#include "vtkSMIntVectorProperty.h" +#include "vtkSMProperty.h" +#include "vtkSMSourceProxy.h" + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +pqPV3blockMeshReaderPanel::pqPV3blockMeshReaderPanel +( + pqProxy *proxy, + QWidget *p +) +: + pqAutoGeneratedObjectPanel(proxy, p), + sourceProxy_(vtkSMSourceProxy::SafeDownCast(this->proxy())) +{ + // create first sublayout (at top of the panel) + QGridLayout *sect1 = new QGridLayout(); + this->PanelLayout->addLayout(sect1, 0, 0, 1, -1); + + + // checkbox for showing point numbers + ShowPointNumbers_ = new QCheckBox("Show Point Numbers"); + ShowPointNumbers_->setChecked(true); + + connect + ( + ShowPointNumbers_, + SIGNAL(stateChanged(int)), + this, + SLOT(ShowPointNumbersToggled()) + ); + + sect1->addWidget(ShowPointNumbers_); + + + // immediate update on the Server Manager side + vtkSMIntVectorProperty::SafeDownCast + ( + sourceProxy_->GetProperty("UiShowPointNumbers") + )->SetImmediateUpdate(true); + +} + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void pqPV3blockMeshReaderPanel::ShowPointNumbersToggled() +{ + vtkSMIntVectorProperty::SafeDownCast + ( + sourceProxy_->GetProperty("UiShowPointNumbers") + )->SetElement(0, ShowPointNumbers_->isChecked()); +} + + +// ************************************************************************* // diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.h b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.h index 1f3c2ba9b2..8096338315 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.h +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/pqPV3blockMeshReaderPanel.h @@ -1,34 +1,94 @@ -#ifndef __pqPV3blockMeshReaderPanel_h -#define __pqPV3blockMeshReaderPanel_h +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + pqPV3blockMeshReaderPanel + +Description + GUI modifications for the ParaView reader panel + + A custom panel for the PV3blockMeshReader. + +SourceFiles + pqPV3blockMeshReaderPanel.cxx + +\*---------------------------------------------------------------------------*/ +#ifndef pqPV3blockMeshReaderPanel_h +#define pqPV3blockMeshReaderPanel_h #include "pqAutoGeneratedObjectPanel.h" -#include -#include -// -// Custom panel for PV3blockMeshReader source. -// +// Forward declaration of QT classes + +class QCheckBox; +class QLineEdit; +class QTimer; +class QToolButton; + +// Forward declaration of ParaView classes +class vtkSMSourceProxy; + + +/*---------------------------------------------------------------------------*\ + Class pqPV3blockMeshReaderPanel Declaration +\*---------------------------------------------------------------------------*/ + class pqPV3blockMeshReaderPanel : public pqAutoGeneratedObjectPanel { + // Private data Q_OBJECT; typedef pqAutoGeneratedObjectPanel Superclass; + //- Server Manager Source Proxy + vtkSMSourceProxy* sourceProxy_; + + //- Show Point Numbers checkbox + QCheckBox* ShowPointNumbers_; + +protected slots: + + void ShowPointNumbersToggled(); + + public: - pqPV3blockMeshReaderPanel(pqProxy *proxy, QWidget *p) - : - pqAutoGeneratedObjectPanel(proxy, p) - { - this->layout()->addWidget - ( - new QLabel("Plugin for reading OpenFOAM blockMesh files", this) - ); - } - //virtual ~pqPV3blockMeshReaderPanel(); + // Constructors + + //- Construct from components + pqPV3blockMeshReaderPanel(pqProxy*, QWidget*); + + + //- Destructor + // virtual ~pqPV3blockMeshReaderPanel(); -protected: }; -#endif //__pqPV3blockMeshReaderPanel_h + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx index 383deeeccc..bf17a60ca3 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.cxx @@ -1,18 +1,28 @@ -/*========================================================================= +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. - Program: Visualization Toolkit - Module: $RCSfile: vtkPV3blockMeshReader.cxx,v $ + 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 2 of the License, or (at your + option) any later version. - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + 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. - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +\*---------------------------------------------------------------------------*/ #include "vtkPV3blockMeshReader.h" #include "pqApplicationCore.h" @@ -33,9 +43,14 @@ // Foam includes #include "vtkPV3blockMesh.H" -vtkCxxRevisionMacro(vtkPV3blockMeshReader, "$Revision: 1.5$"); +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +vtkCxxRevisionMacro(vtkPV3blockMeshReader, "$Revision:$"); vtkStandardNewMacro(vtkPV3blockMeshReader); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + vtkPV3blockMeshReader::vtkPV3blockMeshReader() { Debug = 0; @@ -76,6 +91,8 @@ vtkPV3blockMeshReader::vtkPV3blockMeshReader() } +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + vtkPV3blockMeshReader::~vtkPV3blockMeshReader() { vtkDebugMacro(<<"Deconstructor"); @@ -100,6 +117,8 @@ vtkPV3blockMeshReader::~vtkPV3blockMeshReader() } +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + // Do everything except set the output info int vtkPV3blockMeshReader::RequestInformation ( @@ -216,6 +235,17 @@ int vtkPV3blockMeshReader::RequestData } + +void vtkPV3blockMeshReader::SetShowPointNumbers(const int val) +{ + if (ShowPointNumbers != val) + { + ShowPointNumbers = val; + updatePointNumbersView(ShowPointNumbers); + } +} + + void vtkPV3blockMeshReader::updatePointNumbersView(const bool show) { pqApplicationCore* appCore = pqApplicationCore::instance(); @@ -228,14 +258,14 @@ void vtkPV3blockMeshReader::updatePointNumbersView(const bool show) // Server manager model for querying items in the server manager pqServerManagerModel* smModel = appCore->getServerManagerModel(); - if (!smModel) + if (!smModel || !foamData_) { return; } + // Get all the pqRenderView instances QList renderViews = smModel->findItems(); - for (int viewI=0; viewIrenderPointNumbers @@ -244,6 +274,8 @@ void vtkPV3blockMeshReader::updatePointNumbersView(const bool show) show ); } + + // use refresh here? } diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h index b26cde357d..ae704d4a3b 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/vtkPV3blockMeshReader.h @@ -1,38 +1,61 @@ -/*========================================================================= +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. - Program: Visualization Toolkit - Module: $RCSfile: vtkPV3blockMeshReader.h,v $ + 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 2 of the License, or (at your + option) any later version. - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + 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. - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -=========================================================================*/ -// .NAME vtkPV3blockMeshReader - reads a dataset in OpenFOAM bockMesh format -// .SECTION Description -// vtkPV3blockMeshReader creates an multiblock dataset. -// It uses the OpenFOAM infrastructure (blockMesh). +Class + vtkPV3blockMeshReader -#ifndef __vtkPV3blockMeshReader_h -#define __vtkPV3blockMeshReader_h +Description + reads a dataset in OpenFOAM bockMesh format -// Foam forward declarations -namespace Foam -{ - class vtkPV3blockMesh; -} + vtkPV3blockMeshReader creates an multiblock dataset. + It uses the OpenFOAM infrastructure (blockMesh). + +SourceFiles + vtkPV3blockMeshReader.cxx + +\*---------------------------------------------------------------------------*/ + +#ifndef vtkPV3blockMeshReader_h +#define vtkPV3blockMeshReader_h // VTK includes #include "vtkMultiBlockDataSetAlgorithm.h" +// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * // + // VTK forward declarations class vtkDataArraySelection; class vtkCallbackCommand; +namespace Foam +{ + class vtkPV3blockMesh; +} + +/*---------------------------------------------------------------------------*\ + Class vtkPV3blockMeshReader Declaration +\*---------------------------------------------------------------------------*/ class VTK_IO_EXPORT vtkPV3blockMeshReader : @@ -49,15 +72,16 @@ public: vtkSetStringMacro(FileName); vtkGetStringMacro(FileName); + // Description: + // Display corner point labels + virtual void SetShowPointNumbers(int); + vtkGetMacro(ShowPointNumbers, int); + // Description: // GUI update control vtkSetMacro(UpdateGUI, int); vtkGetMacro(UpdateGUI, int); - // Description: - // FOAM display patch names control - vtkSetMacro(ShowPointNumbers, int); - vtkGetMacro(ShowPointNumbers, int); // Description: // Parts (blocks) selection list control @@ -121,6 +145,7 @@ protected: char* FileName; + private: //- Disallow default bitwise copy construct @@ -132,6 +157,8 @@ private: //- Add/remove point numbers to/from the view void updatePointNumbersView(const bool show); + + //- Show Point Numbers int ShowPointNumbers; //- Dummy variable/switch to invoke a reader update diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H index a8ce36e144..85ddd163b9 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkOpenFOAMPoints.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C index 91424d3b57..e9d36ec91e 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H index 6001267ef8..a159b3cba5 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C index 5ad588bb30..4f76f5ebf2 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C index b948c5e979..bde724d9a7 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshUtils.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License From d8cf3901d3160e56b7f78700ee16a47aa5f4dd6c Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 27 Oct 2009 13:55:25 +0100 Subject: [PATCH 05/40] added doc/codingStyleGuide.org for central revision --- doc/codingStyleGuide.org | 275 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 275 insertions(+) create mode 100644 doc/codingStyleGuide.org diff --git a/doc/codingStyleGuide.org b/doc/codingStyleGuide.org new file mode 100644 index 0000000000..d9c5c3c9c6 --- /dev/null +++ b/doc/codingStyleGuide.org @@ -0,0 +1,275 @@ +# -*- mode: org; -*- +# +#+TITLE: OpenFOAM C++ style guide +#+AUTHOR: OpenCFD Ltd. +#+DATE: November 2009 +#+LINK: http://www.opencfd.co.uk +#+OPTIONS: author:nil ^:{} + +* OpenFOAM C++ style guide + +*** General + + 80 character lines max + + The body of control statements (eg, if, else, while, etc). + always delineated with brace brackets + + + stream output + << is always four characters after the start of the stream, so that the << + symbols align, i.e. + + Info<< + os << + + + so + + WarningIn("className::functionName()") + << "Warning message" + + NOT + + WarningIn("className::functionName()") + << "Warning message" + + + no unnecessary class section headers, i.e. remove + + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + + // Check + + // Edit + + // Write + + if they contain nothing, even if planned for 'future use' + + + class titles are centred + + /*---------------------------------------------------------------------------*\ + Class exampleClass Declaration + \*---------------------------------------------------------------------------*/ + + NOT + + /*---------------------------------------------------------------------------*\ + Class exampleClass Declaration + \*---------------------------------------------------------------------------*/ + +*** .H Files + + header file spacing + Leave two empty lines between sections (as per functions in the .C file etc) + + + use "//- Comment" comments in header file + + add descriptions to class data and functions + + destructor + If adding a comment to the destructor - use //- and code as a normal function: + + //- Destructor + ~className(); + + inline functions + Use inline functions where appropriate in a separate classNameI.H file. + Do not clutter up the header file with function bodies + +*** .C Files + + Do not open/close namespaces in a .C file + Fully scope the function name, i.e. + + Foam::returnType Foam::className::functionName() + + NOT + + namespace Foam + { + ... + + returnType className::functionName() + + ... + } + + EXCEPTION + + When there are multiple levels of namespace, they may be used in the .C + file, i.e. + + namespace Foam + { + namespace compressible + { + namespace RASModels + { + + ... + + } // End namespace RASModels + } // End namespace compressible + } // End namespace Foam + + + Use two empty lines between functions + +*** Coding Practise + + passing data as arguments or return + Pass label and scalar as copy, anything bigger by reference + + const + Use everywhere it is applicable. + + variable initialisation using "=" + + const className& variableName = otherClass.data(); + + NOT + + const className& variableName(otherClass.data()); + + + virtual functions + If a class is virtual - make all derived classes virtual. + +*** Conditional Statements + if (condition) + { + code; + } + + OR + + if + ( + long condition + ) + { + code; + } + + NOT (no space between "if" and "(") + + if(condition) + { + code; + } + +*** `for' Loops + for (i = 0; i < maxI; i++) + { + code; + } + + OR + + for + ( + i = 0; + i < maxI; + i++ + ) + { + code; + } + + NOT (no space between "for" and "(") + + for(i = 0; i < maxI; i++) + { + code; + } + +*** `forAll' loops + like for loops, but + + forAll( + + NOT + + forAll ( + +*** Splitting Over Multiple Lines + + splitting return type and function name + + split initially after the function return type and left align + + + do not put "const" onto it's own line - use a split to keep it with the + function name and arguments. + + so: + + const Foam::longReturnTypeName& + Foam::longClassName::longFunctionName const + + NOT + + const Foam::longReturnTypeName& + Foam::longClassName::longFunctionName const + + NOR + + const Foam::longReturnTypeName& Foam::longClassName::longFunctionName + const + + NOR + + const Foam::longReturnTypeName& Foam::longClassName:: + longFunctionName const + + + + if need to split again, split at the function name (leaving behind the + preceding scoping "::"'s), and again, left align, i.e. + + const Foam::longReturnTypeName& + Foam::veryveryveryverylongClassName:: + veryveryveryverylongFunctionName const + + + splitting long lines at an "=" + + Indent after split + + variableName = + longClassName.longFunctionName(longArgument); + + OR (where necessary) + + variableName = + longClassName.longFunctionName + ( + longArgument1, + longArgument2 + ); + + NOT + + variableName = + longClassName.longFunctionName(longArgument); + + NOR + + variableName = longClassName.longFunctionName + ( + longArgument1, + longArgument2 + ); + +*** Maths and Logic + + operator spacing + + a + b, a - b + + a*b, a/b + + a & b, a ^ b + + a = b, a != b + + a < b, a > b, a >= b, a <= b + + a || b, a && b + + + splitting formulae over several lines + Split and indent as per "splitting long lines at an "="" + with the operator on the lower line. Align operator so that first + variable, function or bracket on the next line is 4 spaces indented i.e. + + variableName = + a*(a + b) + - exp(c/d) + *(k + t) + + + splitting logical tests over several lines + + indent operator so that the next variable to test is aligned with the + four space indentation, i.e. + + if + ( + a == true + && b == c + ) From f5aa277982850b31a92dd442b5b888ef1a826399 Mon Sep 17 00:00:00 2001 From: henry Date: Fri, 30 Oct 2009 17:22:55 +0000 Subject: [PATCH 06/40] Minor clean-up. --- .../motorBike/constant/polyMesh/boundary | 144 +++++++++--------- .../simpleFoam/motorBike/system/fvSchemes | 8 +- .../simpleFoam/motorBike/system/fvSolution | 5 + 3 files changed, 81 insertions(+), 76 deletions(-) diff --git a/tutorials/incompressible/simpleFoam/motorBike/constant/polyMesh/boundary b/tutorials/incompressible/simpleFoam/motorBike/constant/polyMesh/boundary index b79c6ad432..3c2a064fff 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/constant/polyMesh/boundary +++ b/tutorials/incompressible/simpleFoam/motorBike/constant/polyMesh/boundary @@ -21,433 +21,433 @@ FoamFile { type patch; nFaces 320; - startFace 1016586; + startFace 1016673; } inlet { type patch; nFaces 64; - startFace 1016906; + startFace 1016993; } outlet { type patch; nFaces 64; - startFace 1016970; + startFace 1017057; } lowerWall { type wall; nFaces 5330; - startFace 1017034; + startFace 1017121; } upperWall { type patch; nFaces 160; - startFace 1022364; + startFace 1022451; } motorBike_frt-fairing:001%1 { type wall; nFaces 6626; - startFace 1022524; + startFace 1022611; } motorBike_windshield:002%2 { type wall; nFaces 50; - startFace 1029150; + startFace 1029237; } motorBike_rr-wh-rim:005%5 { type wall; nFaces 181; - startFace 1029200; + startFace 1029287; } motorBike_rr-wh-rim:010%10 { type wall; nFaces 340; - startFace 1029381; + startFace 1029468; } motorBike_fr-wh-rim:011%11 { type wall; nFaces 474; - startFace 1029721; + startFace 1029808; } motorBike_fr-wh-brake-disk:012%12 { type wall; nFaces 54; - startFace 1030195; + startFace 1030282; } motorBike_frame:016-shadow%13 { type wall; nFaces 131; - startFace 1030249; + startFace 1030336; } motorBike_rear-susp:014%14 { type wall; nFaces 1073; - startFace 1030380; + startFace 1030467; } motorBike_rear-susp:014-shadow%15 { type wall; nFaces 159; - startFace 1031453; + startFace 1031540; } motorBike_frame:016%16 { type wall; nFaces 20; - startFace 1031612; + startFace 1031699; } motorBike_rr-wh-rim:005-shadow%17 { type wall; nFaces 25; - startFace 1031632; + startFace 1031719; } motorBike_rr-wh-chain-hub:022%22 { type wall; nFaces 141; - startFace 1031657; + startFace 1031744; } motorBike_rearseat%24 { type wall; nFaces 432; - startFace 1031798; + startFace 1031885; } motorBike_frt-fairing%25 { type wall; nFaces 626; - startFace 1032230; + startFace 1032317; } motorBike_windshield%26 { type wall; nFaces 428; - startFace 1032856; + startFace 1032943; } motorBike_headlights%27 { type wall; nFaces 161; - startFace 1033284; + startFace 1033371; } motorBike_driversseat%28 { type wall; nFaces 367; - startFace 1033445; + startFace 1033532; } motorBike_rear-body%29 { type wall; nFaces 2076; - startFace 1033812; + startFace 1033899; } motorBike_fuel-tank%30 { type wall; nFaces 912; - startFace 1035888; + startFace 1035975; } motorBike_exhaust%31 { type wall; nFaces 2391; - startFace 1036800; + startFace 1036887; } motorBike_rr-wh-rim%32 { type wall; nFaces 1430; - startFace 1039191; + startFace 1039278; } motorBike_fr-mud-guard%33 { type wall; nFaces 767; - startFace 1040621; + startFace 1040708; } motorBike_fr-wh-rim%34 { type wall; nFaces 592; - startFace 1041388; + startFace 1041475; } motorBike_fr-wh-brake-disk%35 { type wall; nFaces 533; - startFace 1041980; + startFace 1042067; } motorBike_fr-brake-caliper%36 { type wall; nFaces 164; - startFace 1042513; + startFace 1042600; } motorBike_fr-wh-tyre%37 { type wall; nFaces 1118; - startFace 1042677; + startFace 1042764; } motorBike_hbars%38 { type wall; nFaces 535; - startFace 1043795; + startFace 1043882; } motorBike_fr-forks%39 { type wall; nFaces 1144; - startFace 1044330; + startFace 1044417; } motorBike_chain%40 { type wall; nFaces 474; - startFace 1045474; + startFace 1045561; } motorBike_rr-wh-tyre%41 { type wall; nFaces 1785; - startFace 1045948; + startFace 1046035; } motorBike_square-dial%42 { type wall; nFaces 6; - startFace 1047733; + startFace 1047820; } motorBike_round-dial%43 { type wall; nFaces 18; - startFace 1047739; + startFace 1047826; } motorBike_dial-holder%44 { type wall; nFaces 87; - startFace 1047757; + startFace 1047844; } motorBike_rear-susp%45 { type wall; nFaces 1787; - startFace 1047844; + startFace 1047931; } motorBike_rear-brake-lights%46 { type wall; nFaces 54; - startFace 1049631; + startFace 1049718; } motorBike_rear-light-bracket%47 { type wall; nFaces 163; - startFace 1049685; + startFace 1049772; } motorBike_frame%48 { type wall; nFaces 2040; - startFace 1049848; + startFace 1049935; } motorBike_rear-mud-guard%49 { type wall; nFaces 804; - startFace 1051888; + startFace 1051975; } motorBike_rear-susp-spring-damp%50 { type wall; nFaces 125; - startFace 1052692; + startFace 1052779; } motorBike_fairing-inner-plate%51 { type wall; nFaces 446; - startFace 1052817; + startFace 1052904; } motorBike_clutch-housing%52 { type wall; nFaces 966; - startFace 1053263; + startFace 1053350; } motorBike_radiator%53 { type wall; nFaces 48; - startFace 1054229; + startFace 1054316; } motorBike_water-pipe%54 { type wall; nFaces 103; - startFace 1054277; + startFace 1054364; } motorBike_water-pump%55 { type wall; nFaces 74; - startFace 1054380; + startFace 1054467; } motorBike_engine%56 { type wall; nFaces 2384; - startFace 1054454; + startFace 1054541; } motorBike_rear-shock-link%57 { type wall; nFaces 29; - startFace 1056838; + startFace 1056925; } motorBike_rear-brake-fluid-pot-bracket%58 { type wall; nFaces 59; - startFace 1056867; + startFace 1056954; } motorBike_rear-brake-fluid-pot%59 { type wall; nFaces 53; - startFace 1056926; + startFace 1057013; } motorBike_footpeg%60 { type wall; nFaces 87; - startFace 1056979; + startFace 1057066; } motorBike_rr-wh-chain-hub%61 { type wall; nFaces 145; - startFace 1057066; + startFace 1057153; } motorBike_rear-brake-caliper%62 { type wall; nFaces 142; - startFace 1057211; + startFace 1057298; } motorBike_rider-helmet%65 { type wall; nFaces 583; - startFace 1057353; + startFace 1057440; } motorBike_rider-visor%66 { type wall; nFaces 95; - startFace 1057936; + startFace 1058023; } motorBike_rider-boots%67 { type wall; nFaces 1025; - startFace 1058031; + startFace 1058118; } motorBike_rider-gloves%68 { type wall; nFaces 320; - startFace 1059056; + startFace 1059143; } motorBike_rider-body%69 { type wall; nFaces 4555; - startFace 1059376; + startFace 1059463; } motorBike_frame:0%70 { type wall; nFaces 37; - startFace 1063931; + startFace 1064018; } motorBike_frt-fairing:001-shadow%74 { type wall; nFaces 1274; - startFace 1063968; + startFace 1064055; } motorBike_windshield-shadow%75 { type wall; nFaces 101; - startFace 1065242; + startFace 1065329; } motorBike_fr-mud-guard-shadow%81 { type wall; nFaces 129; - startFace 1065343; + startFace 1065430; } motorBike_fr-wh-brake-disk-shadow%83 { type wall; nFaces 77; - startFace 1065472; + startFace 1065559; } motorBike_rear-mud-guard-shadow%84 { type wall; nFaces 138; - startFace 1065549; + startFace 1065636; } motorBike_rear-susp-spring-damp-shadow%85 { type wall; nFaces 15; - startFace 1065687; + startFace 1065774; } motorBike_radiator-shadow%86 { type wall; nFaces 12; - startFace 1065702; + startFace 1065789; } motorBike_rear-shock-link-shadow%87 { type wall; nFaces 7; - startFace 1065714; + startFace 1065801; } motorBike_rear-brake-fluid-pot-bracket-shadow%88 { type wall; nFaces 6; - startFace 1065721; + startFace 1065808; } motorBike_rr-wh-chain-hub-shadow%89 { type wall; nFaces 24; - startFace 1065727; + startFace 1065814; } ) diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes b/tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes index 5081411979..7297493347 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes +++ b/tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes @@ -24,13 +24,13 @@ gradSchemes default Gauss linear; grad(p) Gauss linear; grad(U) Gauss linear; -// grad(U) cellLimited Gauss linear 1; + //grad(U) cellLimited Gauss linear 1; } divSchemes { default none; - div(phi,U) Gauss linearUpwindV Gauss linear; + div(phi,U) Gauss linearUpwind grad(U); div(phi,k) Gauss upwind; div(phi,omega) Gauss upwind; div((nuEff*dev(grad(U).T()))) Gauss linear; @@ -39,8 +39,8 @@ divSchemes laplacianSchemes { default Gauss linear corrected; -// default Gauss linear limited 0.5; -// default Gauss linear limited 0.333; + //default Gauss linear limited 0.5; + //default Gauss linear limited 0.333; } interpolationSchemes diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/fvSolution b/tutorials/incompressible/simpleFoam/motorBike/system/fvSolution index 3b0a3e35b6..e99098b5b9 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/fvSolution +++ b/tutorials/incompressible/simpleFoam/motorBike/system/fvSolution @@ -71,4 +71,9 @@ relaxationFactors omega 0.7; } +cache +{ + grad(U); +} + // ************************************************************************* // From 9bb3c1c1badd4715018dccc296a227c1ac4234b1 Mon Sep 17 00:00:00 2001 From: henry Date: Fri, 30 Oct 2009 17:24:02 +0000 Subject: [PATCH 07/40] New solvers and tutorial cases transferred from OpenFOAM-1.6.x. --- .../porousSimpleFoam/Make/files | 3 + .../porousSimpleFoam/Make/options | 14 ++ .../incompressible/porousSimpleFoam/UEqn.H | 47 ++++ .../porousSimpleFoam/createFields.H | 64 ++++++ .../incompressible/porousSimpleFoam/pEqn.H | 59 +++++ .../porousSimpleFoam/porousSimpleFoam.C | 85 +++++++ .../multiphase/interMixingFoam/Make/files | 6 + .../multiphase/interMixingFoam/Make/options | 17 ++ .../multiphase/interMixingFoam/alphaEqns.H | 164 ++++++++++++++ .../interMixingFoam/alphaEqnsSubCycle.H | 43 ++++ .../multiphase/interMixingFoam/createFields.H | 132 +++++++++++ .../threePhaseMixture.C | 204 +++++++++++++++++ .../threePhaseMixture.H | 197 +++++++++++++++++ .../interMixingFoam/interMixingFoam.C | 102 +++++++++ .../threePhaseInterfaceProperties.C | 209 ++++++++++++++++++ .../threePhaseInterfaceProperties.H | 157 +++++++++++++ .../porousSimpleFoam/angledDuctExplicit/0 | 1 + .../angledDuctExplicit/constant | 1 + .../angledDuctExplicit/system/controlDict | 51 +++++ .../angledDuctExplicit/system/fvSchemes | 64 ++++++ .../angledDuctExplicit/system/fvSolution | 65 ++++++ .../porousSimpleFoam/angledDuctImplicit/0/T | 54 +++++ .../porousSimpleFoam/angledDuctImplicit/0/U | 57 +++++ .../angledDuctImplicit/0/epsilon | 64 ++++++ .../porousSimpleFoam/angledDuctImplicit/0/k | 64 ++++++ .../porousSimpleFoam/angledDuctImplicit/0/nut | 62 ++++++ .../porousSimpleFoam/angledDuctImplicit/0/p | 51 +++++ .../angledDuctImplicit/constant/RASProperties | 25 +++ .../constant/polyMesh/blockMeshDict | 123 +++++++++++ .../constant/polyMesh/blockMeshDict.m4 | 165 ++++++++++++++ .../constant/polyMesh/boundary | 58 +++++ .../angledDuctImplicit/constant/porousZones | 36 +++ .../constant/transportProperties | 21 ++ .../angledDuctImplicit/system/controlDict | 51 +++++ .../angledDuctImplicit/system/fvSchemes | 64 ++++++ .../angledDuctImplicit/system/fvSolution | 57 +++++ .../interMixingFoam/laminar/damBreak/0/U | 51 +++++ .../laminar/damBreak/0/alpha1.org | 51 +++++ .../laminar/damBreak/0/alpha2.org | 51 +++++ .../laminar/damBreak/0/alpha3.org | 51 +++++ .../interMixingFoam/laminar/damBreak/0/p | 59 +++++ .../interMixingFoam/laminar/damBreak/Allclean | 4 + .../interMixingFoam/laminar/damBreak/Allrun | 10 + .../laminar/damBreak/constant/dynamicMeshDict | 21 ++ .../laminar/damBreak/constant/g | 22 ++ .../damBreak/constant/polyMesh/blockMeshDict | 92 ++++++++ .../damBreak/constant/polyMesh/boundary | 52 +++++ .../damBreak/constant/transportProperties | 49 ++++ .../damBreak/constant/turbulenceProperties | 21 ++ .../laminar/damBreak/system/controlDict | 55 +++++ .../laminar/damBreak/system/decomposeParDict | 50 +++++ .../laminar/damBreak/system/fvSchemes | 59 +++++ .../laminar/damBreak/system/fvSolution | 73 ++++++ .../laminar/damBreak/system/setFieldsDict | 50 +++++ 54 files changed, 3458 insertions(+) create mode 100644 applications/solvers/incompressible/porousSimpleFoam/Make/files create mode 100644 applications/solvers/incompressible/porousSimpleFoam/Make/options create mode 100644 applications/solvers/incompressible/porousSimpleFoam/UEqn.H create mode 100644 applications/solvers/incompressible/porousSimpleFoam/createFields.H create mode 100644 applications/solvers/incompressible/porousSimpleFoam/pEqn.H create mode 100644 applications/solvers/incompressible/porousSimpleFoam/porousSimpleFoam.C create mode 100644 applications/solvers/multiphase/interMixingFoam/Make/files create mode 100644 applications/solvers/multiphase/interMixingFoam/Make/options create mode 100644 applications/solvers/multiphase/interMixingFoam/alphaEqns.H create mode 100644 applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H create mode 100644 applications/solvers/multiphase/interMixingFoam/createFields.H create mode 100644 applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.C create mode 100644 applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.H create mode 100644 applications/solvers/multiphase/interMixingFoam/interMixingFoam.C create mode 100644 applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C create mode 100644 applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H create mode 120000 tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/0 create mode 120000 tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/constant create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/controlDict create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSchemes create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSolution create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/T create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/U create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/epsilon create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/k create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/nut create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/p create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/RASProperties create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4 create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/boundary create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/porousZones create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/transportProperties create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/controlDict create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSchemes create mode 100644 tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSolution create mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/0/U create mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/0/alpha1.org create mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/0/alpha2.org create mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/0/alpha3.org create mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/0/p create mode 100755 tutorials/multiphase/interMixingFoam/laminar/damBreak/Allclean create mode 100755 tutorials/multiphase/interMixingFoam/laminar/damBreak/Allrun create mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/dynamicMeshDict create mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/g create mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/polyMesh/blockMeshDict create mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/polyMesh/boundary create mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/transportProperties create mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/turbulenceProperties create mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/system/controlDict create mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/system/decomposeParDict create mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSchemes create mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSolution create mode 100644 tutorials/multiphase/interMixingFoam/laminar/damBreak/system/setFieldsDict diff --git a/applications/solvers/incompressible/porousSimpleFoam/Make/files b/applications/solvers/incompressible/porousSimpleFoam/Make/files new file mode 100644 index 0000000000..e72f7ed78c --- /dev/null +++ b/applications/solvers/incompressible/porousSimpleFoam/Make/files @@ -0,0 +1,3 @@ +porousSimpleFoam.C + +EXE = $(FOAM_APPBIN)/porousSimpleFoam diff --git a/applications/solvers/incompressible/porousSimpleFoam/Make/options b/applications/solvers/incompressible/porousSimpleFoam/Make/options new file mode 100644 index 0000000000..f490133ba6 --- /dev/null +++ b/applications/solvers/incompressible/porousSimpleFoam/Make/options @@ -0,0 +1,14 @@ +EXE_INC = \ + -I../simpleFoam \ + -I$(LIB_SRC)/turbulenceModels \ + -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +EXE_LIBS = \ + -lincompressibleRASModels \ + -lincompressibleTransportModels \ + -lfiniteVolume \ + -lmeshTools diff --git a/applications/solvers/incompressible/porousSimpleFoam/UEqn.H b/applications/solvers/incompressible/porousSimpleFoam/UEqn.H new file mode 100644 index 0000000000..c1925c7708 --- /dev/null +++ b/applications/solvers/incompressible/porousSimpleFoam/UEqn.H @@ -0,0 +1,47 @@ + // Construct the Momentum equation + + tmp UEqn + ( + fvm::div(phi, U) + - fvm::Sp(fvc::div(phi), U) + + turbulence->divDevReff(U) + ); + + UEqn().relax(); + + // Include the porous media resistance and solve the momentum equation + // either implicit in the tensorial resistance or transport using by + // including the spherical part of the resistance in the momentum diagonal + + tmp trAU; + tmp trTU; + + if (pressureImplicitPorosity) + { + tmp tTU = tensor(I)*UEqn().A(); + pZones.addResistance(UEqn(), tTU()); + trTU = inv(tTU()); + trTU().rename("rAU"); + + volVectorField gradp = fvc::grad(p); + + for (int UCorr=0; UCorr turbulence + ( + incompressible::RASModel::New(U, phi, laminarTransport) + ); + + + porousZones pZones(mesh); + Switch pressureImplicitPorosity(false); + + int nUCorr = 0; + if (pZones.size()) + { + // nUCorrectors for pressureImplicitPorosity + if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors")) + { + nUCorr = readInt + ( + mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors") + ); + } + + if (nUCorr > 0) + { + pressureImplicitPorosity = true; + } + } diff --git a/applications/solvers/incompressible/porousSimpleFoam/pEqn.H b/applications/solvers/incompressible/porousSimpleFoam/pEqn.H new file mode 100644 index 0000000000..e6797cd860 --- /dev/null +++ b/applications/solvers/incompressible/porousSimpleFoam/pEqn.H @@ -0,0 +1,59 @@ +if (pressureImplicitPorosity) +{ + U = trTU()&UEqn().H(); +} +else +{ + U = trAU()*UEqn().H(); +} + +UEqn.clear(); +phi = fvc::interpolate(U) & mesh.Sf(); +adjustPhi(phi, U, p); + +for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) +{ + tmp tpEqn; + + if (pressureImplicitPorosity) + { + tpEqn = (fvm::laplacian(trTU(), p) == fvc::div(phi)); + } + else + { + tpEqn = (fvm::laplacian(trAU(), p) == fvc::div(phi)); + } + + tpEqn().setReference(pRefCell, pRefValue); + // retain the residual from the first iteration + if (nonOrth == 0) + { + eqnResidual = tpEqn().solve().initialResidual(); + maxResidual = max(eqnResidual, maxResidual); + } + else + { + tpEqn().solve(); + } + + if (nonOrth == nNonOrthCorr) + { + phi -= tpEqn().flux(); + } +} + +#include "continuityErrs.H" + +// Explicitly relax pressure for momentum corrector +p.relax(); + +if (pressureImplicitPorosity) +{ + U -= trTU()&fvc::grad(p); +} +else +{ + U -= trAU()*fvc::grad(p); +} + +U.correctBoundaryConditions(); diff --git a/applications/solvers/incompressible/porousSimpleFoam/porousSimpleFoam.C b/applications/solvers/incompressible/porousSimpleFoam/porousSimpleFoam.C new file mode 100644 index 0000000000..b78f1688fe --- /dev/null +++ b/applications/solvers/incompressible/porousSimpleFoam/porousSimpleFoam.C @@ -0,0 +1,85 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + porousSimpleFoam + +Description + Steady-state solver for incompressible, turbulent flow with + implicit or explicit porosity treatment + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "singlePhaseTransportModel.H" +#include "RASModel.H" +#include "porousZones.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" + #include "initContinuityErrs.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.loop()) + { + Info<< "Time = " << runTime.timeName() << nl << endl; + + #include "readSIMPLEControls.H" + #include "initConvergenceCheck.H" + + p.storePrevIter(); + + // Pressure-velocity SIMPLE corrector + { + #include "UEqn.H" + #include "pEqn.H" + } + + turbulence->correct(); + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + + #include "convergenceCheck.H" + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/interMixingFoam/Make/files b/applications/solvers/multiphase/interMixingFoam/Make/files new file mode 100644 index 0000000000..488cd77e56 --- /dev/null +++ b/applications/solvers/multiphase/interMixingFoam/Make/files @@ -0,0 +1,6 @@ +incompressibleThreePhaseMixture/threePhaseMixture.C +threePhaseInterfaceProperties/threePhaseInterfaceProperties.C +interMixingFoam.C + +EXE = $(FOAM_APPBIN)/interMixingFoam + diff --git a/applications/solvers/multiphase/interMixingFoam/Make/options b/applications/solvers/multiphase/interMixingFoam/Make/options new file mode 100644 index 0000000000..d8e4da2313 --- /dev/null +++ b/applications/solvers/multiphase/interMixingFoam/Make/options @@ -0,0 +1,17 @@ +INTERFOAM = $(FOAM_SOLVERS)/multiphase/interFoam + +EXE_INC = \ + -I$(INTERFOAM) \ + -IincompressibleThreePhaseMixture \ + -IthreePhaseInterfaceProperties \ + -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/transportModels + +EXE_LIBS = \ + -linterfaceProperties \ + -lincompressibleTransportModels \ + -lincompressibleRASModels \ + -lincompressibleLESModels \ + -lfiniteVolume diff --git a/applications/solvers/multiphase/interMixingFoam/alphaEqns.H b/applications/solvers/multiphase/interMixingFoam/alphaEqns.H new file mode 100644 index 0000000000..f9bad0a705 --- /dev/null +++ b/applications/solvers/multiphase/interMixingFoam/alphaEqns.H @@ -0,0 +1,164 @@ +{ + word alphaScheme("div(phi,alpha)"); + word alpharScheme("div(phirb,alpha)"); + + surfaceScalarField phir + ( + IOobject + ( + "phir", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + interface.cAlpha()*mag(phi/mesh.magSf())*interface.nHatf() + ); + + for (int gCorr=0; gCorr(mesh, phi).flux(alpha1); + + // Calculate the flux correction for alpha1 + phiAlpha1 -= phiAlpha1BD; + + // Calculate the limiter for alpha1 + MULES::limiter + ( + allLambda, + oneField(), + alpha1, + phiAlpha1BD, + phiAlpha1, + zeroField(), + zeroField(), + 1, + 0, + 3 + ); + + // Create the complete flux for alpha2 + surfaceScalarField phiAlpha2 = + fvc::flux + ( + phi, + alpha2, + alphaScheme + ) + + fvc::flux + ( + -fvc::flux(phir, alpha1, alpharScheme), + alpha2, + alpharScheme + ); + + // Create the bounded (upwind) flux for alpha2 + surfaceScalarField phiAlpha2BD = + upwind(mesh, phi).flux(alpha2); + + // Calculate the flux correction for alpha2 + phiAlpha2 -= phiAlpha2BD; + + // Further limit the limiter for alpha2 + MULES::limiter + ( + allLambda, + oneField(), + alpha2, + phiAlpha2BD, + phiAlpha2, + zeroField(), + zeroField(), + 1, + 0, + 3 + ); + + // Construct the limited fluxes + phiAlpha1 = phiAlpha1BD + lambda*phiAlpha1; + phiAlpha2 = phiAlpha2BD + lambda*phiAlpha2; + + // Solve for alpha1 + solve(fvm::ddt(alpha1) + fvc::div(phiAlpha1)); + + // Create the diffusion coefficients for alpha2<->alpha3 + volScalarField Dc23 = D23*max(alpha3, scalar(0))*pos(alpha2); + volScalarField Dc32 = D23*max(alpha2, scalar(0))*pos(alpha3); + + // Add the diffusive flux for alpha3->alpha2 + phiAlpha2 -= fvc::interpolate(Dc32)*mesh.magSf()*fvc::snGrad(alpha1); + + // Solve for alpha2 + fvScalarMatrix alpha2Eqn + ( + fvm::ddt(alpha2) + + fvc::div(phiAlpha2) + - fvm::laplacian(Dc23 + Dc32, alpha2) + ); + alpha2Eqn.solve(); + + // Construct the complete mass flux + rhoPhi = + phiAlpha1*(rho1 - rho3) + + (phiAlpha2 + alpha2Eqn.flux())*(rho2 - rho3) + + phi*rho3; + + alpha3 = 1.0 - alpha1 - alpha2; + } + + Info<< "Air phase volume fraction = " + << alpha1.weightedAverage(mesh.V()).value() + << " Min(alpha1) = " << min(alpha1).value() + << " Max(alpha1) = " << max(alpha1).value() + << endl; + + Info<< "Liquid phase volume fraction = " + << alpha2.weightedAverage(mesh.V()).value() + << " Min(alpha2) = " << min(alpha2).value() + << " Max(alpha2) = " << max(alpha2).value() + << endl; +} diff --git a/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H new file mode 100644 index 0000000000..765087a183 --- /dev/null +++ b/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H @@ -0,0 +1,43 @@ +label nAlphaCorr +( + readLabel(piso.lookup("nAlphaCorr")) +); + +label nAlphaSubCycles +( + readLabel(piso.lookup("nAlphaSubCycles")) +); + +if (nAlphaSubCycles > 1) +{ + surfaceScalarField rhoPhiSum = 0.0*rhoPhi; + dimensionedScalar totalDeltaT = runTime.deltaT(); + + for + ( + subCycle alphaSubCycle(alpha1, nAlphaSubCycles); + !(++alphaSubCycle).end(); + ) + { +# include "alphaEqns.H" + rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi; + } + + rhoPhi = rhoPhiSum; +} +else +{ +# include "alphaEqns.H" +} + +interface.correct(); + +{ + volScalarField rhoNew = alpha1*rho1 + alpha2*rho2 + alpha3*rho3; + + //solve(fvm::ddt(rho) + fvc::div(rhoPhi)); + //Info<< "density error = " + // << max((mag(rho - rhoNew)/mag(rhoNew))().internalField()) << endl; + + rho == rhoNew; +} diff --git a/applications/solvers/multiphase/interMixingFoam/createFields.H b/applications/solvers/multiphase/interMixingFoam/createFields.H new file mode 100644 index 0000000000..9615e6c186 --- /dev/null +++ b/applications/solvers/multiphase/interMixingFoam/createFields.H @@ -0,0 +1,132 @@ + Info<< "Reading field p\n" << endl; + volScalarField p + ( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< "Reading field alpha1\n" << endl; + volScalarField alpha1 + ( + IOobject + ( + "alpha1", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + + Info<< "Reading field alpha2\n" << endl; + volScalarField alpha2 + ( + IOobject + ( + "alpha2", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + + Info<< "Reading field alpha3\n" << endl; + volScalarField alpha3 + ( + IOobject + ( + "alpha3", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + alpha3 == 1.0 - alpha1 - alpha2; + + + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + +# include "createPhi.H" + + threePhaseMixture threePhaseProperties(U, phi); + + const dimensionedScalar& rho1 = threePhaseProperties.rho1(); + const dimensionedScalar& rho2 = threePhaseProperties.rho2(); + const dimensionedScalar& rho3 = threePhaseProperties.rho3(); + + dimensionedScalar D23(threePhaseProperties.lookup("D23")); + + // Need to store rho for ddt(rho, U) + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT + ), + alpha1*rho1 + alpha2*rho2 + alpha3*rho3, + alpha1.boundaryField().types() + ); + rho.oldTime(); + + + // Mass flux + // Initialisation does not matter because rhoPhi is reset after the + // alpha solution before it is used in the U equation. + surfaceScalarField rhoPhi + ( + IOobject + ( + "rho*phi", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + rho1*phi + ); + + + label pRefCell = 0; + scalar pRefValue = 0.0; + setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); + + + // Construct interface from alpha distribution + threePhaseInterfaceProperties interface(threePhaseProperties); + + + // Construct incompressible turbulence model + autoPtr turbulence + ( + incompressible::turbulenceModel::New(U, phi, threePhaseProperties) + ); diff --git a/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.C b/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.C new file mode 100644 index 0000000000..f27e17923f --- /dev/null +++ b/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.C @@ -0,0 +1,204 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 2 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, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Class + threePhaseMixture + +\*---------------------------------------------------------------------------*/ + +#include "threePhaseMixture.H" +#include "addToRunTimeSelectionTable.H" +#include "surfaceFields.H" +#include "fvc.H" + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +//- Calculate and return the laminar viscosity +void Foam::threePhaseMixture::calcNu() +{ + // Average kinematic viscosity calculated from dynamic viscosity + nu_ = mu()/(alpha1_*rho1_ + alpha2_*rho2_ + alpha3_*rho3_); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::threePhaseMixture::threePhaseMixture +( + const volVectorField& U, + const surfaceScalarField& phi +) +: + transportModel(U, phi), + + phase1Name_("phase1"), + phase2Name_("phase2"), + phase3Name_("phase3"), + + nuModel1_ + ( + viscosityModel::New + ( + "nu1", + subDict(phase1Name_), + U, + phi + ) + ), + nuModel2_ + ( + viscosityModel::New + ( + "nu2", + subDict(phase2Name_), + U, + phi + ) + ), + nuModel3_ + ( + viscosityModel::New + ( + "nu3", + subDict(phase2Name_), + U, + phi + ) + ), + + rho1_(nuModel1_->viscosityProperties().lookup("rho")), + rho2_(nuModel2_->viscosityProperties().lookup("rho")), + rho3_(nuModel3_->viscosityProperties().lookup("rho")), + + U_(U), + phi_(phi), + + alpha1_(U_.db().lookupObject ("alpha1")), + alpha2_(U_.db().lookupObject ("alpha2")), + alpha3_(U_.db().lookupObject ("alpha3")), + + nu_ + ( + IOobject + ( + "nu", + U_.time().timeName(), + U_.db() + ), + U_.mesh(), + dimensionedScalar("nu", dimensionSet(0, 2, -1, 0, 0), 0), + calculatedFvPatchScalarField::typeName + ) +{ + calcNu(); +} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::tmp Foam::threePhaseMixture::mu() const +{ + return tmp + ( + new volScalarField + ( + "mu", + alpha1_*rho1_*nuModel1_->nu() + + alpha2_*rho2_*nuModel2_->nu() + + alpha3_*rho3_*nuModel3_->nu() + ) + ); +} + + +Foam::tmp Foam::threePhaseMixture::muf() const +{ + surfaceScalarField alpha1f = fvc::interpolate(alpha1_); + surfaceScalarField alpha2f = fvc::interpolate(alpha2_); + surfaceScalarField alpha3f = fvc::interpolate(alpha3_); + + return tmp + ( + new surfaceScalarField + ( + "mu", + alpha1f*rho1_*fvc::interpolate(nuModel1_->nu()) + + alpha2f*rho2_*fvc::interpolate(nuModel2_->nu()) + + alpha3f*rho3_*fvc::interpolate(nuModel3_->nu()) + ) + ); +} + + +Foam::tmp Foam::threePhaseMixture::nuf() const +{ + surfaceScalarField alpha1f = fvc::interpolate(alpha1_); + surfaceScalarField alpha2f = fvc::interpolate(alpha2_); + surfaceScalarField alpha3f = fvc::interpolate(alpha3_); + + return tmp + ( + new surfaceScalarField + ( + "nu", + ( + alpha1f*rho1_*fvc::interpolate(nuModel1_->nu()) + + alpha2f*rho2_*fvc::interpolate(nuModel2_->nu()) + + alpha3f*rho3_*fvc::interpolate(nuModel3_->nu()) + )/(alpha1f*rho1_ + alpha2f*rho2_ + alpha3f*rho3_) + ) + ); +} + + +bool Foam::threePhaseMixture::read() +{ + if (transportModel::read()) + { + if + ( + nuModel1_().read(*this) + && nuModel2_().read(*this) + && nuModel3_().read(*this) + ) + { + nuModel1_->viscosityProperties().lookup("rho") >> rho1_; + nuModel2_->viscosityProperties().lookup("rho") >> rho2_; + nuModel3_->viscosityProperties().lookup("rho") >> rho3_; + + return true; + } + else + { + return false; + } + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.H b/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.H new file mode 100644 index 0000000000..2712b5d0cb --- /dev/null +++ b/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.H @@ -0,0 +1,197 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 2 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, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Class + threePhaseMixture + +Description + +SourceFiles + threePhaseMixture.C + +\*---------------------------------------------------------------------------*/ + +#ifndef threePhaseMixture_H +#define threePhaseMixture_H + +#include "incompressible/transportModel/transportModel.H" +#include "incompressible/viscosityModels/viscosityModel/viscosityModel.H" +#include "dimensionedScalar.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class threePhaseMixture Declaration +\*---------------------------------------------------------------------------*/ + +class threePhaseMixture +: + public transportModel +{ + // Private data + + word phase1Name_; + word phase2Name_; + word phase3Name_; + + autoPtr nuModel1_; + autoPtr nuModel2_; + autoPtr nuModel3_; + + dimensionedScalar rho1_; + dimensionedScalar rho2_; + dimensionedScalar rho3_; + + const volVectorField& U_; + const surfaceScalarField& phi_; + + const volScalarField& alpha1_; + const volScalarField& alpha2_; + const volScalarField& alpha3_; + + volScalarField nu_; + + + // Private Member Functions + + //- Calculate and return the laminar viscosity + void calcNu(); + + +public: + + // Constructors + + //- Construct from components + threePhaseMixture + ( + const volVectorField& U, + const surfaceScalarField& phi + ); + + + // Destructor + + ~threePhaseMixture() + {} + + + // Member Functions + + //- Return const-access to phase1 viscosityModel + const viscosityModel& nuModel1() const + { + return nuModel1_(); + } + + //- Return const-access to phase2 viscosityModel + const viscosityModel& nuModel2() const + { + return nuModel2_(); + } + + //- Return const-access to phase3 viscosityModel + const viscosityModel& nuModel3() const + { + return nuModel3_(); + } + + //- Return const-access to phase1 density + const dimensionedScalar& rho1() const + { + return rho1_; + } + + //- Return const-access to phase2 density + const dimensionedScalar& rho2() const + { + return rho2_; + }; + + //- Return const-access to phase3 density + const dimensionedScalar& rho3() const + { + return rho3_; + }; + + const volScalarField& alpha1() const + { + return alpha1_; + } + + const volScalarField& alpha2() const + { + return alpha2_; + } + + const volScalarField& alpha3() const + { + return alpha3_; + } + + //- Return the velocity + const volVectorField& U() const + { + return U_; + } + + //- Return the dynamic laminar viscosity + tmp mu() const; + + //- Return the face-interpolated dynamic laminar viscosity + tmp muf() const; + + //- Return the kinematic laminar viscosity + tmp nu() const + { + return nu_; + } + + //- Return the face-interpolated dynamic laminar viscosity + tmp nuf() const; + + //- Correct the laminar viscosity + void correct() + { + calcNu(); + } + + //- Read base transportProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C b/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C new file mode 100644 index 0000000000..a18df8d12a --- /dev/null +++ b/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C @@ -0,0 +1,102 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 2 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, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Application + interMixingFoam + +Description + Solver for 3 incompressible fluids, two of which are miscible, + using a VOF method to capture the interface. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "MULES.H" +#include "subCycle.H" +#include "threePhaseMixture.H" +#include "threePhaseInterfaceProperties.H" +#include "turbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readGravitationalAcceleration.H" + #include "readPISOControls.H" + #include "initContinuityErrs.H" + #include "createFields.H" + #include "readTimeControls.H" + #include "CourantNo.H" + #include "setInitialDeltaT.H" + #include "correctPhi.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + #include "readPISOControls.H" + #include "readTimeControls.H" + #include "CourantNo.H" + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + threePhaseProperties.correct(); + + #include "alphaEqnsSubCycle.H" + + #define twoPhaseProperties threePhaseProperties + #include "UEqn.H" + + // --- PISO loop + for (int corr=0; corrcorrect(); + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "\n end \n"; + + return(0); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C b/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C new file mode 100644 index 0000000000..1ab10bd743 --- /dev/null +++ b/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C @@ -0,0 +1,209 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 2 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, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Application + threePhaseInterfaceProperties + +Description + Properties to aid interFoam : + 1. Correct the alpha boundary condition for dynamic contact angle. + 2. Calculate interface curvature. + +\*---------------------------------------------------------------------------*/ + +#include "threePhaseInterfaceProperties.H" +#include "alphaContactAngleFvPatchScalarField.H" +#include "mathematicalConstants.H" +#include "surfaceInterpolate.H" +#include "fvcDiv.H" +#include "fvcGrad.H" + +// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // + +const Foam::scalar Foam::threePhaseInterfaceProperties::convertToRad = + Foam::constant::mathematical::pi/180.0; + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +// Correction for the boundary condition on the unit normal nHat on +// walls to produce the correct contact angle. + +// The dynamic contact angle is calculated from the component of the +// velocity on the direction of the interface, parallel to the wall. + +void Foam::threePhaseInterfaceProperties::correctContactAngle +( + surfaceVectorField::GeometricBoundaryField& nHatb +) const +{ + const volScalarField::GeometricBoundaryField& alpha1 = + mixture_.alpha1().boundaryField(); + const volScalarField::GeometricBoundaryField& alpha2 = + mixture_.alpha2().boundaryField(); + const volScalarField::GeometricBoundaryField& alpha3 = + mixture_.alpha3().boundaryField(); + const volVectorField::GeometricBoundaryField& U = + mixture_.U().boundaryField(); + + const fvMesh& mesh = mixture_.U().mesh(); + const fvBoundaryMesh& boundary = mesh.boundary(); + + forAll(boundary, patchi) + { + if (isA(alpha1[patchi])) + { + const alphaContactAngleFvPatchScalarField& a2cap = + refCast + (alpha2[patchi]); + + const alphaContactAngleFvPatchScalarField& a3cap = + refCast + (alpha3[patchi]); + + scalarField twoPhaseAlpha2 = max(a2cap, scalar(0)); + scalarField twoPhaseAlpha3 = max(a3cap, scalar(0)); + + scalarField sumTwoPhaseAlpha = + twoPhaseAlpha2 + twoPhaseAlpha3 + SMALL; + + twoPhaseAlpha2 /= sumTwoPhaseAlpha; + twoPhaseAlpha3 /= sumTwoPhaseAlpha; + + fvsPatchVectorField& nHatp = nHatb[patchi]; + + scalarField theta = + convertToRad + *( + twoPhaseAlpha2*(180 - a2cap.theta(U[patchi], nHatp)) + + twoPhaseAlpha3*(180 - a3cap.theta(U[patchi], nHatp)) + ); + + vectorField nf = boundary[patchi].nf(); + + // Reset nHatPatch to correspond to the contact angle + + scalarField a12 = nHatp & nf; + + scalarField b1 = cos(theta); + + scalarField b2(nHatp.size()); + + forAll(b2, facei) + { + b2[facei] = cos(acos(a12[facei]) - theta[facei]); + } + + scalarField det = 1.0 - a12*a12; + + scalarField a = (b1 - a12*b2)/det; + scalarField b = (b2 - a12*b1)/det; + + nHatp = a*nf + b*nHatp; + + nHatp /= (mag(nHatp) + deltaN_.value()); + } + } +} + + +void Foam::threePhaseInterfaceProperties::calculateK() +{ + const volScalarField& alpha1 = mixture_.alpha1(); + + const fvMesh& mesh = alpha1.mesh(); + const surfaceVectorField& Sf = mesh.Sf(); + + // Cell gradient of alpha + volVectorField gradAlpha = fvc::grad(alpha1); + + // Interpolated face-gradient of alpha + surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha); + + // Face unit interface normal + surfaceVectorField nHatfv = gradAlphaf/(mag(gradAlphaf) + deltaN_); + correctContactAngle(nHatfv.boundaryField()); + + // Face unit interface normal flux + nHatf_ = nHatfv & Sf; + + // Simple expression for curvature + K_ = -fvc::div(nHatf_); + + // Complex expression for curvature. + // Correction is formally zero but numerically non-zero. + //volVectorField nHat = gradAlpha/(mag(gradAlpha) + deltaN_); + //nHat.boundaryField() = nHatfv.boundaryField(); + //K_ = -fvc::div(nHatf_) + (nHat & fvc::grad(nHatfv) & nHat); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::threePhaseInterfaceProperties::threePhaseInterfaceProperties +( + const threePhaseMixture& mixture +) +: + mixture_(mixture), + cAlpha_ + ( + readScalar + ( + mixture.U().mesh().solutionDict().subDict("PISO").lookup("cAlpha") + ) + ), + sigma12_(mixture.lookup("sigma12")), + sigma13_(mixture.lookup("sigma13")), + + deltaN_ + ( + "deltaN", + 1e-8/pow(average(mixture.U().mesh().V()), 1.0/3.0) + ), + + nHatf_ + ( + ( + fvc::interpolate(fvc::grad(mixture.alpha1())) + /(mag(fvc::interpolate(fvc::grad(mixture.alpha1()))) + deltaN_) + ) & mixture.alpha1().mesh().Sf() + ), + + K_ + ( + IOobject + ( + "K", + mixture.alpha1().time().timeName(), + mixture.alpha1().mesh() + ), + -fvc::div(nHatf_) + ) +{ + calculateK(); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H b/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H new file mode 100644 index 0000000000..3a402feeed --- /dev/null +++ b/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H @@ -0,0 +1,157 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 2 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, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Class + threePhaseInterfaceProperties + +Description + Properties to aid interFoam : + 1. Correct the alpha boundary condition for dynamic contact angle. + 2. Calculate interface curvature. + +SourceFiles + threePhaseInterfaceProperties.C + +\*---------------------------------------------------------------------------*/ + +#ifndef threePhaseInterfaceProperties_H +#define threePhaseInterfaceProperties_H + +#include "threePhaseMixture.H" +#include "surfaceFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class threePhaseInterfaceProperties Declaration +\*---------------------------------------------------------------------------*/ + +class threePhaseInterfaceProperties +{ + // Private data + + const threePhaseMixture& mixture_; + + //- Compression coefficient + scalar cAlpha_; + + //- Surface tension 1-2 + dimensionedScalar sigma12_; + + //- Surface tension 1-3 + dimensionedScalar sigma13_; + + //- Stabilisation for normalisation of the interface normal + const dimensionedScalar deltaN_; + + surfaceScalarField nHatf_; + volScalarField K_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct and assignment + threePhaseInterfaceProperties(const threePhaseInterfaceProperties&); + void operator=(const threePhaseInterfaceProperties&); + + //- Correction for the boundary condition on the unit normal nHat on + // walls to produce the correct contact dynamic angle + // calculated from the component of U parallel to the wall + void correctContactAngle + ( + surfaceVectorField::GeometricBoundaryField& nHat + ) const; + + //- Re-calculate the interface curvature + void calculateK(); + + +public: + + //- Conversion factor for degrees into radians + static const scalar convertToRad; + + + // Constructors + + //- Construct from volume fraction field alpha and IOdictionary + threePhaseInterfaceProperties(const threePhaseMixture& mixture); + + + // Member Functions + + scalar cAlpha() const + { + return cAlpha_; + } + + const dimensionedScalar& deltaN() const + { + return deltaN_; + } + + const surfaceScalarField& nHatf() const + { + return nHatf_; + } + + const volScalarField& K() const + { + return K_; + } + + tmp sigma() const + { + volScalarField limitedAlpha2 = max(mixture_.alpha2(), scalar(0)); + volScalarField limitedAlpha3 = max(mixture_.alpha3(), scalar(0)); + + return + (limitedAlpha2*sigma12_ + limitedAlpha3*sigma13_) + /(limitedAlpha2 + limitedAlpha3 + SMALL); + } + + tmp sigmaK() const + { + return sigma()*K_; + } + + void correct() + { + calculateK(); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/0 b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/0 new file mode 120000 index 0000000000..f1c4a884b5 --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/0 @@ -0,0 +1 @@ +../angledDuctImplicit/0 \ No newline at end of file diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/constant b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/constant new file mode 120000 index 0000000000..28205c782b --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/constant @@ -0,0 +1 @@ +../angledDuctImplicit/constant \ No newline at end of file diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/controlDict b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/controlDict new file mode 100644 index 0000000000..9ffe4063cf --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/controlDict @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application rhoPorousSimpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 200; + +deltaT 1; + +writeControl timeStep; + +writeInterval 10; + +purgeWrite 0; + +writeFormat binary; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +graphFormat raw; + +runTimeModifiable yes; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSchemes b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSchemes new file mode 100644 index 0000000000..a70c35e1bf --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSchemes @@ -0,0 +1,64 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; + grad(U) Gauss linear; + grad(p) Gauss linear; +} + +divSchemes +{ + div(phi,U) Gauss upwind; + div((nuEff*dev(grad(U).T()))) Gauss linear; + div(phi,epsilon) Gauss upwind; + div(phi,k) Gauss upwind; +} + +laplacianSchemes +{ + laplacian(nuEff,U) Gauss linear corrected; + laplacian(rAU,p) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; + laplacian(DkEff,k) Gauss linear corrected; + laplacian(1,p) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSolution b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSolution new file mode 100644 index 0000000000..b7d4dbd573 --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSolution @@ -0,0 +1,65 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + tolerance 1e-08; + relTol 0.05; + smoother GaussSeidel; + cacheAgglomeration off; + nCellsInCoarsestLevel 20; + agglomerator faceAreaPair; + mergeLevels 1; + } + + U + { + solver smoothSolver; + smoother GaussSeidel; + nSweeps 2; + tolerance 1e-06; + relTol 0.1; + } + + "(k|epsilon)" + { + solver smoothSolver; + smoother GaussSeidel; + nSweeps 2; + tolerance 1e-07; + relTol 0.1; + } +} + +SIMPLE +{ + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + p 0.3; + U 0.7; + k 0.9; + epsilon 0.9; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/T b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/T new file mode 100644 index 0000000000..e1df943987 --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/T @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 293; + +boundaryField +{ + + front + { + type zeroGradient; + } + back + { + type zeroGradient; + } + wall + { + type zeroGradient; + } + porosityWall + { + type zeroGradient; + } + + inlet + { + type fixedValue; + value $internalField; + } + outlet + { + type inletOutlet; + value $internalField; + inletValue $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/U b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/U new file mode 100644 index 0000000000..88f5094258 --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/U @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + front + { + type fixedValue; + value uniform (0 0 0); + } + back + { + type fixedValue; + value uniform (0 0 0); + } + wall + { + type fixedValue; + value uniform (0 0 0); + } + porosityWall + { + type slip; + value uniform (0 0 0); + } + inlet + { + type flowRateInletVelocity; + flowRate 0.1; + value uniform (0 0 0); + } + outlet + { + type inletOutlet; + value uniform (0 0 0); + inletValue uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/epsilon b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/epsilon new file mode 100644 index 0000000000..d43279e3d7 --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/epsilon @@ -0,0 +1,64 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -3 0 0 0 0 ]; + +internalField uniform 200; + +boundaryField +{ + front + { + type epsilonWallFunction; + value uniform 200; + } + + back + { + type epsilonWallFunction; + value uniform 200; + } + + wall + { + type epsilonWallFunction; + value uniform 200; + } + + porosityWall + { + type epsilonWallFunction; + value uniform 200; + } + + inlet + { + type turbulentMixingLengthDissipationRateInlet; + mixingLength 0.005; + value uniform 200; + } + + outlet + { + type inletOutlet; + inletValue uniform 200; + value uniform 200; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/k b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/k new file mode 100644 index 0000000000..8a7e20d154 --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/k @@ -0,0 +1,64 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -2 0 0 0 0 ]; + +internalField uniform 1; + +boundaryField +{ + front + { + type kqRWallFunction; + value uniform 1; + } + + back + { + type kqRWallFunction; + value uniform 1; + } + + wall + { + type kqRWallFunction; + value uniform 1; + } + + porosityWall + { + type kqRWallFunction; + value uniform 1; + } + + inlet + { + type turbulentIntensityKineticEnergyInlet; + intensity 0.05; + value uniform 1; + } + + outlet + { + type inletOutlet; + inletValue uniform 1; + value uniform 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/nut b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/nut new file mode 100644 index 0000000000..de1c9477df --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/nut @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + front + { + type nutWallFunction; + value uniform 0; + } + + back + { + type nutWallFunction; + value uniform 0; + } + + wall + { + type nutWallFunction; + value uniform 0; + } + + porosityWall + { + type nutWallFunction; + value uniform 0; + } + + inlet + { + type calculated; + value uniform 0; + } + + outlet + { + type calculated; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/p b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/p new file mode 100644 index 0000000000..4794b84b18 --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/p @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + front + { + type zeroGradient; + } + back + { + type zeroGradient; + } + wall + { + type zeroGradient; + } + porosityWall + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + outlet + { + type fixedValue; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/RASProperties b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/RASProperties new file mode 100644 index 0000000000..48cf724e26 --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/RASProperties @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class dictionary; + location "constant"; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kEpsilon; + +turbulence on; + +printCoeffs on; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000..0438819b25 --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict @@ -0,0 +1,123 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// block definition for a porosity with an angled inlet/outlet +// the porosity is not aligned with the main axes +// + +convertToMeters 0.001; + +vertices +( + // inlet region + ( -150 0 -25 ) // pt 0 (in1b) + ( -150 35.35533906 -25 ) // pt 1 (in2b) + ( -150 0 25 ) // pt 2 (in1f) + ( -150 35.35533906 25 ) // pt 3 (in2f) + + // join inlet->outlet + ( 0 0 -25 ) // pt 4 (join1b) + ( -35.35533906 35.35533906 -25 ) // pt 5 (join2b) + ( 0 0 25 ) // pt 6 (join1f) + ( -35.35533906 35.35533906 25 ) // pt 7 (join2f) + + // porosity ends ->outlet + ( 70.71067812 70.71067812 -25 ) // pt 8 (poro1b) + ( 35.35533906 106.06601718 -25 ) // pt 9 (poro2b) + ( 70.71067812 70.71067812 25 ) // pt 10 (poro1f) + ( 35.35533906 106.06601718 25 ) // pt 11 (poro2f) + + // outlet + ( 141.42135624 141.42135624 -25 ) // pt 12 (out1b) + ( 106.06601718 176.7766953 -25 ) // pt 13 (out2b) + ( 141.42135624 141.42135624 25 ) // pt 14 (out1f) + ( 106.06601718 176.7766953 25 ) // pt 15 (out2f) +); + +blocks +( + // inlet block + hex (0 4 5 1 2 6 7 3) + inlet ( 15 20 20 ) simpleGrading (1 1 1) + + // porosity block + hex (4 8 9 5 6 10 11 7) + porosity ( 20 20 20 ) simpleGrading (1 1 1) + + // outlet block + hex (8 12 13 9 10 14 15 11) + outlet ( 20 20 20 ) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + // is there no way of defining all my 'defaultFaces' to be 'wall'? + wall front + ( + // inlet block + (2 6 7 3) + // outlet block + (10 14 15 11) + ) + + wall back + ( + // inlet block + (1 5 4 0) + // outlet block + (9 13 12 8) + ) + + wall wall + ( + // inlet block + (2 0 4 6) + (7 5 1 3) + // outlet block + (10 8 12 14) + (15 13 9 11) + ) + + wall porosityWall + ( + // porosity block + (6 10 11 7) + // porosity block + (5 9 8 4) + // porosity block + (6 4 8 10) + (11 9 5 7) + ) + + patch inlet + ( + (3 1 0 2) + ) + + patch outlet + ( + (15 13 12 14) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4 b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4 new file mode 100644 index 0000000000..6d6d066939 --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4 @@ -0,0 +1,165 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + `format' ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// block definition for a porosity with an angled inlet/outlet +// the porosity is not aligned with the main axes +// +dnl> ----------------------------------------------------------------- +dnl> +dnl> +changecom(//)changequote([,]) dnl> +define(calc, [esyscmd(perl -e 'print ($1)')]) dnl> +define(VCOUNT, 0) dnl> +define(vlabel, [[// ]pt VCOUNT ($1) define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) dnl> +dnl> +define(hex2D, hex ($1b $2b $3b $4b $1f $2f $3f $4f)) dnl> +define(quad2D, ($1f $1b $2b $2f)) dnl> +define(frontQuad, ($1f $2f $3f $4f)) dnl> +define(backQuad, ($4b $3b $2b $1b)) dnl> +dnl> +dnl> +dnl> ----------------------------------------------------------------- +dnl> +define(ncells, 20) dnl> +define(ninlet, 15) dnl> +define(nporo, 20) dnl> +define(noutlet, 20) dnl> +dnl> +define(x0,0) dnl> +define(y0,0) dnl> +define(y0,0) dnl> +define(Cos,0.7071067812) dnl> == cos(45) +define(Sin,0.7071067812) dnl> == sin(45) +dnl> +define(width,50) dnl> +define(zBack,calc(-width/2)) dnl> +define(zFront,calc(width/2)) dnl> +define(leninlet,150)dnl> +define(lenporo,100)dnl> +define(lenoutlet,100)dnl> +dnl> +define(xhyp,calc(Sin*width)) dnl> +define(yhyp,calc(Cos*width)) dnl> +define(xinlet,leninlet)dnl> +define(xporo,calc(Cos*lenporo)) dnl> +define(yporo,calc(Sin*lenporo)) dnl> +define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl> +define(youtlet,calc(yporo + Sin*lenoutlet)) dnl> +dnl> + +convertToMeters 0.001; + +vertices +( + // inlet region + ( -xinlet y0 zBack ) vlabel(in1b) + ( -xinlet yhyp zBack ) vlabel(in2b) + ( -xinlet y0 zFront ) vlabel(in1f) + ( -xinlet yhyp zFront ) vlabel(in2f) + + // join inlet->outlet + ( x0 y0 zBack ) vlabel(join1b) + ( -xhyp yhyp zBack ) vlabel(join2b) + ( x0 y0 zFront ) vlabel(join1f) + ( -xhyp yhyp zFront ) vlabel(join2f) + + // porosity ends ->outlet + ( xporo yporo zBack ) vlabel(poro1b) + ( calc(xporo - xhyp) calc(yporo + yhyp) zBack ) vlabel(poro2b) + ( xporo yporo zFront ) vlabel(poro1f) + ( calc(xporo - xhyp) calc(yporo + yhyp) zFront ) vlabel(poro2f) + + // outlet + ( xoutlet youtlet zBack ) vlabel(out1b) + ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zBack ) vlabel(out2b) + ( xoutlet youtlet zFront ) vlabel(out1f) + ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zFront ) vlabel(out2f) +); + +blocks +( + // inlet block + hex2D(in1, join1, join2, in2) + inlet ( ninlet ncells ncells ) simpleGrading (1 1 1) + + // porosity block + hex2D(join1, poro1, poro2, join2) + porosity ( nporo ncells ncells ) simpleGrading (1 1 1) + + // outlet block + hex2D(poro1, out1, out2, poro2) + outlet ( noutlet ncells ncells ) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + // is there no way of defining all my 'defaultFaces' to be 'wall'? + wall front + ( + // inlet block + frontQuad(in1, join1, join2, in2) + // outlet block + frontQuad(poro1, out1, out2, poro2) + ) + + wall back + ( + // inlet block + backQuad(in1, join1, join2, in2) + // outlet block + backQuad(poro1, out1, out2, poro2) + ) + + wall wall + ( + // inlet block + quad2D(in1, join1) + quad2D(join2, in2) + // outlet block + quad2D(poro1, out1) + quad2D(out2, poro2) + ) + + wall porosityWall + ( + // porosity block + frontQuad(join1, poro1, poro2, join2) + // porosity block + backQuad(join1, poro1, poro2, join2) + // porosity block + quad2D(join1, poro1) + quad2D(poro2, join2) + ) + + patch inlet + ( + quad2D(in2, in1) + ) + + patch outlet + ( + quad2D(out2, out1) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/boundary b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/boundary new file mode 100644 index 0000000000..948cb99e43 --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/boundary @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +6 +( + front + { + type wall; + nFaces 700; + startFace 63400; + } + back + { + type wall; + nFaces 700; + startFace 64100; + } + wall + { + type wall; + nFaces 1400; + startFace 64800; + } + porosityWall + { + type wall; + nFaces 1600; + startFace 66200; + } + inlet + { + type patch; + nFaces 400; + startFace 67800; + } + outlet + { + type patch; + nFaces 400; + startFace 68200; + } +) + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/porousZones b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/porousZones new file mode 100644 index 0000000000..634799837e --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/porousZones @@ -0,0 +1,36 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object porousZones; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +1 +( + porosity + { + coordinateSystem + { + e1 (0.70710678 0.70710678 0); + e2 (0 0 1); + } + + Darcy + { + d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000); + f f [0 -1 0 0 0 0 0] (0 0 0); + } + } +) + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/transportProperties b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/transportProperties new file mode 100644 index 0000000000..7f3bedaae5 --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/transportProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu nu [0 2 -1 0 0 0 0] 1.5e-05; + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/controlDict b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/controlDict new file mode 100644 index 0000000000..88d62b98cc --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/controlDict @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application rhoPorousSimpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 100; + +deltaT 1; + +writeControl timeStep; + +writeInterval 10; + +purgeWrite 0; + +writeFormat binary; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +graphFormat raw; + +runTimeModifiable yes; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSchemes b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSchemes new file mode 100644 index 0000000000..a70c35e1bf --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSchemes @@ -0,0 +1,64 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; + grad(U) Gauss linear; + grad(p) Gauss linear; +} + +divSchemes +{ + div(phi,U) Gauss upwind; + div((nuEff*dev(grad(U).T()))) Gauss linear; + div(phi,epsilon) Gauss upwind; + div(phi,k) Gauss upwind; +} + +laplacianSchemes +{ + laplacian(nuEff,U) Gauss linear corrected; + laplacian(rAU,p) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; + laplacian(DkEff,k) Gauss linear corrected; + laplacian(1,p) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSolution b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSolution new file mode 100644 index 0000000000..f5f9feafa8 --- /dev/null +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSolution @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + tolerance 1e-08; + relTol 0.05; + smoother GaussSeidel; + cacheAgglomeration off; + nCellsInCoarsestLevel 20; + agglomerator faceAreaPair; + mergeLevels 1; + } + + "(k|epsilon)" + { + solver smoothSolver; + smoother GaussSeidel; + nSweeps 2; + tolerance 1e-07; + relTol 0.1; + } +} + +SIMPLE +{ + nUCorrectors 2; + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + p 0.3; + U 0.7; + k 0.9; + epsilon 0.9; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/U b/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/U new file mode 100644 index 0000000000..26852141c2 --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/U @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + leftWall + { + type fixedValue; + value uniform (0 0 0); + } + rightWall + { + type fixedValue; + value uniform (0 0 0); + } + lowerWall + { + type fixedValue; + value uniform (0 0 0); + } + atmosphere + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/alpha1.org b/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/alpha1.org new file mode 100644 index 0000000000..f0bdefa8cd --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/alpha1.org @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alpha1; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + leftWall + { + type zeroGradient; + } + + rightWall + { + type zeroGradient; + } + + lowerWall + { + type zeroGradient; + } + + atmosphere + { + type inletOutlet; + inletValue uniform 1; + value uniform 1; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/alpha2.org b/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/alpha2.org new file mode 100644 index 0000000000..122e71dace --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/alpha2.org @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alpha2; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + leftWall + { + type zeroGradient; + } + + rightWall + { + type zeroGradient; + } + + lowerWall + { + type zeroGradient; + } + + atmosphere + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/alpha3.org b/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/alpha3.org new file mode 100644 index 0000000000..f3d69ec082 --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/alpha3.org @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alpha3; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + leftWall + { + type zeroGradient; + } + + rightWall + { + type zeroGradient; + } + + lowerWall + { + type zeroGradient; + } + + atmosphere + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/p b/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/p new file mode 100644 index 0000000000..b77bfe9118 --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/0/p @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + leftWall + { + type buoyantPressure; + value uniform 0; + } + + rightWall + { + type buoyantPressure; + value uniform 0; + } + + lowerWall + { + type buoyantPressure; + value uniform 0; + } + + atmosphere + { + type totalPressure; + p0 uniform 0; + U U; + phi phi; + rho rho; + psi none; + gamma 1; + value uniform 0; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/Allclean b/tutorials/multiphase/interMixingFoam/laminar/damBreak/Allclean new file mode 100755 index 0000000000..cff4dbd231 --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/Allclean @@ -0,0 +1,4 @@ +#!/bin/sh + +foamCleanTutorials cases +rm -rf 0/alpha[1-3].gz diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/Allrun b/tutorials/multiphase/interMixingFoam/laminar/damBreak/Allrun new file mode 100755 index 0000000000..15f6fafd90 --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/Allrun @@ -0,0 +1,10 @@ +#!/bin/sh +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh +cp 0/alpha1.org 0/alpha1 +cp 0/alpha2.org 0/alpha2 +cp 0/alpha3.org 0/alpha3 +runApplication setFields +runApplication interMixingFoam diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/dynamicMeshDict b/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/dynamicMeshDict new file mode 100644 index 0000000000..8fa6344965 --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/dynamicMeshDict @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dynamicFvMesh staticFvMesh; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/g b/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/g new file mode 100644 index 0000000000..27d4d32488 --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value ( 0 -9.81 0 ); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000..a2553926d2 --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/polyMesh/blockMeshDict @@ -0,0 +1,92 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.146; + +vertices +( + (0 0 0) + (2 0 0) + (2.16438 0 0) + (4 0 0) + (0 0.32876 0) + (2 0.32876 0) + (2.16438 0.32876 0) + (4 0.32876 0) + (0 4 0) + (2 4 0) + (2.16438 4 0) + (4 4 0) + (0 0 0.1) + (2 0 0.1) + (2.16438 0 0.1) + (4 0 0.1) + (0 0.32876 0.1) + (2 0.32876 0.1) + (2.16438 0.32876 0.1) + (4 0.32876 0.1) + (0 4 0.1) + (2 4 0.1) + (2.16438 4 0.1) + (4 4 0.1) +); + +blocks +( + hex (0 1 5 4 12 13 17 16) (23 8 1) simpleGrading (1 1 1) + hex (2 3 7 6 14 15 19 18) (19 8 1) simpleGrading (1 1 1) + hex (4 5 9 8 16 17 21 20) (23 42 1) simpleGrading (1 1 1) + hex (5 6 10 9 17 18 22 21) (4 42 1) simpleGrading (1 1 1) + hex (6 7 11 10 18 19 23 22) (19 42 1) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + wall leftWall + ( + (0 12 16 4) + (4 16 20 8) + ) + wall rightWall + ( + (7 19 15 3) + (11 23 19 7) + ) + wall lowerWall + ( + (0 1 13 12) + (1 5 17 13) + (5 6 18 17) + (2 14 18 6) + (2 3 15 14) + ) + patch atmosphere + ( + (8 20 21 9) + (9 21 22 10) + (10 22 23 11) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/polyMesh/boundary b/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/polyMesh/boundary new file mode 100644 index 0000000000..cfd3f8c4d4 --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/polyMesh/boundary @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +5 +( + leftWall + { + type wall; + nFaces 50; + startFace 4432; + } + rightWall + { + type wall; + nFaces 50; + startFace 4482; + } + lowerWall + { + type wall; + nFaces 62; + startFace 4532; + } + atmosphere + { + type patch; + nFaces 46; + startFace 4594; + } + defaultFaces + { + type empty; + nFaces 4536; + startFace 4640; + } +) + +// ************************************************************************* // diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/transportProperties b/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/transportProperties new file mode 100644 index 0000000000..3cada9d4de --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/transportProperties @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Air +phase1 +{ + transportModel Newtonian; + nu nu [0 2 -1 0 0 0 0] 1.48e-05; + rho rho [1 -3 0 0 0 0 0] 1; +} + +// Other Liquid +phase2 +{ + transportModel Newtonian; + nu nu [0 2 -1 0 0 0 0] 1e-6; + rho rho [1 -3 0 0 0 0 0] 1010; +} + +// Water +phase3 +{ + transportModel Newtonian; + nu nu [0 2 -1 0 0 0 0] 1e-6; + rho rho [1 -3 0 0 0 0 0] 1000; +} + +// Surface tension coefficients +sigma12 sigma12 [1 0 -2 0 0 0 0] 0.05; +sigma13 sigma13 [1 0 -2 0 0 0 0] 0.04; + +// Diffusivity between miscible phases +D23 D23 [0 2 -1 0 0 0 0] 3e-09; + +// ************************************************************************* // diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/turbulenceProperties b/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/turbulenceProperties new file mode 100644 index 0000000000..9cfc50a3d9 --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/controlDict b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/controlDict new file mode 100644 index 0000000000..a6f556508b --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/controlDict @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application interFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 2; + +deltaT 0.001; + +writeControl adjustableRunTime; + +writeInterval 0.05; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression compressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.5; + +maxDeltaT 1; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/decomposeParDict b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/decomposeParDict new file mode 100644 index 0000000000..f1482468d4 --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/decomposeParDict @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method simple; + +simpleCoeffs +{ + n ( 2 2 1 ); + delta 0.001; +} + +hierarchicalCoeffs +{ + n ( 1 1 1 ); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + processorWeights ( 1 1 1 1 ); +} + +manualCoeffs +{ + dataFile ""; +} + +distributed no; + +roots ( ); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSchemes b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSchemes new file mode 100644 index 0000000000..bc9a069958 --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSchemes @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + div(rho*phi,U) Gauss limitedLinearV 1; + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss interfaceCompression; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p; + pcorr; + "alpha."; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSolution b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSolution new file mode 100644 index 0000000000..f2543e14e1 --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSolution @@ -0,0 +1,73 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "alpha." + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-06; + relTol 0; + nSweeps 1; + } + + pcorr + { + solver PCG; + preconditioner DIC; + tolerance 1e-10; + relTol 0; + } + + p + { + solver PCG; + preconditioner DIC; + tolerance 1e-07; + relTol 0.05; + } + + pFinal + { + solver PCG; + preconditioner DIC; + tolerance 1e-07; + relTol 0; + } + + U + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-06; + relTol 0; + } +} + +PISO +{ + momentumPredictor no; + nCorrectors 3; + nNonOrthogonalCorrectors 0; + nAlphaCorr 1; + nAlphaSubCycles 2; + cAlpha 1; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/setFieldsDict b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/setFieldsDict new file mode 100644 index 0000000000..51ad3170f5 --- /dev/null +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/setFieldsDict @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue alpha1 0 + volScalarFieldValue alpha2 1 + volScalarFieldValue alpha3 0 +); + +regions +( + boxToCell + { + box (0 0 -1) (0.1461 0.292 1); + fieldValues + ( + volScalarFieldValue alpha1 0 + volScalarFieldValue alpha2 0 + volScalarFieldValue alpha3 1 + ); + } + boxToCell + { + box (0.1461 0.05 -1) (1 1 1); + fieldValues + ( + volScalarFieldValue alpha1 1 + volScalarFieldValue alpha2 0 + volScalarFieldValue alpha3 0 + ); + } +); + + +// ************************************************************************* // From 55a89e9db3d78dca419db5f10256b60a1306d076 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 30 Oct 2009 18:31:28 +0100 Subject: [PATCH 08/40] added HashTbl as development replacement for HashTable - rename to HashTable later when it is considered stable --- applications/test/HashTable3/Make/files | 3 + applications/test/HashTable3/Make/options | 2 + applications/test/HashTable3/hashTableTest3.C | 83 +++ src/OpenFOAM/Make/files | 1 + .../containers/HashTables/HashTbl/HashTbl.C | 665 ++++++++++++++++++ .../containers/HashTables/HashTbl/HashTbl.H | 466 ++++++++++++ .../containers/HashTables/HashTbl/HashTblI.H | 548 +++++++++++++++ .../containers/HashTables/HashTbl/HashTblIO.C | 246 +++++++ .../HashTables/HashTbl/HashTblName.C | 33 + 9 files changed, 2047 insertions(+) create mode 100644 applications/test/HashTable3/Make/files create mode 100644 applications/test/HashTable3/Make/options create mode 100644 applications/test/HashTable3/hashTableTest3.C create mode 100644 src/OpenFOAM/containers/HashTables/HashTbl/HashTbl.C create mode 100644 src/OpenFOAM/containers/HashTables/HashTbl/HashTbl.H create mode 100644 src/OpenFOAM/containers/HashTables/HashTbl/HashTblI.H create mode 100644 src/OpenFOAM/containers/HashTables/HashTbl/HashTblIO.C create mode 100644 src/OpenFOAM/containers/HashTables/HashTbl/HashTblName.C diff --git a/applications/test/HashTable3/Make/files b/applications/test/HashTable3/Make/files new file mode 100644 index 0000000000..e8ec193ffa --- /dev/null +++ b/applications/test/HashTable3/Make/files @@ -0,0 +1,3 @@ +hashTableTest3.C + +EXE = $(FOAM_USER_APPBIN)/hashTableTest3 diff --git a/applications/test/HashTable3/Make/options b/applications/test/HashTable3/Make/options new file mode 100644 index 0000000000..6a9e9810b3 --- /dev/null +++ b/applications/test/HashTable3/Make/options @@ -0,0 +1,2 @@ +/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */ +/* EXE_LIBS = -lfiniteVolume */ diff --git a/applications/test/HashTable3/hashTableTest3.C b/applications/test/HashTable3/hashTableTest3.C new file mode 100644 index 0000000000..422e35696c --- /dev/null +++ b/applications/test/HashTable3/hashTableTest3.C @@ -0,0 +1,83 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + + Test speeds for some HashTable operations + +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "HashTable.H" +#include "HashPtrTable.H" +#include "Map.H" +#include "StaticHashTable.H" +#include "HashTbl.H" +#include "cpuTime.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + const label nLoops = 30; + const label nBase = 100000; + const label nSize = nLoops * nBase; + + cpuTime timer; + + // ie, a + // Map