diff --git a/Guides-a4/ProgrammersGuide.pdf b/Guides-a4/ProgrammersGuide.pdf deleted file mode 100644 index ebd495d608..0000000000 Binary files a/Guides-a4/ProgrammersGuide.pdf and /dev/null differ diff --git a/Guides-a4/UserGuide.pdf b/Guides-a4/UserGuide.pdf deleted file mode 100644 index 7524e9d800..0000000000 Binary files a/Guides-a4/UserGuide.pdf and /dev/null differ diff --git a/Guides-usletter/ProgrammersGuide.pdf b/Guides-usletter/ProgrammersGuide.pdf deleted file mode 100644 index a97bc6d99d..0000000000 Binary files a/Guides-usletter/ProgrammersGuide.pdf and /dev/null differ diff --git a/Guides-usletter/UserGuide.pdf b/Guides-usletter/UserGuide.pdf deleted file mode 100644 index 8960561f15..0000000000 Binary files a/Guides-usletter/UserGuide.pdf and /dev/null differ diff --git a/applications/solvers/DNS/dnsFoam/Allwmake b/applications/solvers/DNS/dnsFoam/Allwmake new file mode 100755 index 0000000000..759041a131 --- /dev/null +++ b/applications/solvers/DNS/dnsFoam/Allwmake @@ -0,0 +1,14 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \ + [ "${FFTW_ARCH_PATH##*-}" = system -a -f "/usr/include/fftw3.h" ] +then + wmake +else + echo + echo "Skipping dnsFoam solver (no FFTW)" + echo +fi + +#------------------------------------------------------------------------------ diff --git a/applications/utilities/mesh/conversion/Optional/Allwmake b/applications/utilities/mesh/conversion/Optional/Allwmake index f84479c089..adf350c5c8 100755 --- a/applications/utilities/mesh/conversion/Optional/Allwmake +++ b/applications/utilities/mesh/conversion/Optional/Allwmake @@ -8,7 +8,7 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # Get version info and arch-path . $WM_PROJECT_DIR/etc/config.sh/functions -_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/libccmio) +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio) set -x diff --git a/applications/utilities/miscellaneous/foamInfoExec/foamInfoExec.C b/applications/utilities/miscellaneous/foamInfoExec/foamInfoExec.C index 3b336287f8..3b671c5b4c 100644 --- a/applications/utilities/miscellaneous/foamInfoExec/foamInfoExec.C +++ b/applications/utilities/miscellaneous/foamInfoExec/foamInfoExec.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -23,6 +23,8 @@ License Application foamInfoExec + To simplify parsing of the output, The normal banner information + is suppressed. Group grpMiscUtilities diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt index fbaedcfb30..2761e18f43 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt @@ -47,11 +47,14 @@ QT4_WRAP_CPP(MOC_SRCS pqPVFoamReaderPanel.h) ADD_PARAVIEW_OBJECT_PANEL(IFACES IFACE_SRCS CLASS_NAME pqPVFoamReaderPanel - XML_NAME PVFoamReader # name of SourceProxy in *SM.xml + XML_NAME PVFoamReader # name of SourceProxy in *SM.xml XML_GROUP sources ) -IF("${PARAVIEW_VERSION_MINOR}" EQUAL 0) +# Separate GUI_RESOURCE_FILES deprecated with paraview 4.3 +# so check if version < 4.4 + +IF(("${PARAVIEW_VERSION_MAJOR}" LESS 5) AND ("${PARAVIEW_VERSION_MINOR}" LESS 4)) ADD_PARAVIEW_PLUGIN( PVFoamReader_SM "1.0" SERVER_MANAGER_XML PVFoamReader_SM.xml @@ -61,7 +64,7 @@ IF("${PARAVIEW_VERSION_MINOR}" EQUAL 0) ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS} GUI_RESOURCE_FILES PVFoamReader.xml ) -ELSE("${PARAVIEW_VERSION_MINOR}" EQUAL 0) +ELSE() ADD_PARAVIEW_PLUGIN( PVFoamReader_SM "1.0" SERVER_MANAGER_XML PVFoamReader_SM.xml @@ -70,7 +73,7 @@ ELSE("${PARAVIEW_VERSION_MINOR}" EQUAL 0) GUI_SOURCES pqPVFoamReaderPanel.cxx ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS} ) -ENDIF("${PARAVIEW_VERSION_MINOR}" EQUAL 0) +ENDIF() TARGET_LINK_LIBRARIES( PVFoamReader_SM diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/PVFoamReader.xml b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/PVFoamReader.xml index aef46449b3..5507293c67 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/PVFoamReader.xml +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/PVFoamReader.xml @@ -1,4 +1,5 @@ + diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/Make/options b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/Make/options index a78b301d97..a2bd6aa18d 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/Make/options +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/Make/options @@ -1,18 +1,12 @@ -/* Note: enable vtkPolyhedron when available */ - EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ - -I../../vtkPVReaders/lnInclude \ - -I../PVFoamReader \ -I$(ParaView_INCLUDE_DIR) \ -I$(ParaView_INCLUDE_DIR)/vtkkwiml \ - $(shell \ - test -f $(ParaView_INCLUDE_DIR)/vtkPolyhedron.h && \ - echo "-DHAS_VTK_POLYHEDRON" || echo "-UHAS_VTK_POLYHEDRON" \ - ) + -I../../vtkPVReaders/lnInclude \ + -I../PVFoamReader LIB_LIBS = \ -lmeshTools \ diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshVolume.C b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshVolume.C index c4a52dbc98..1d7b732339 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshVolume.C +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshVolume.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -275,7 +275,6 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh // Polyhedral cell - use VTK_POLYHEDRON const labelList& cFaces = mesh.cells()[cellI]; -#ifdef HAS_VTK_POLYHEDRON vtkIdType nFaces = cFaces.size(); vtkIdType nLabels = nFaces; @@ -320,33 +319,6 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh } vtkmesh->InsertNextCell(VTK_POLYHEDRON, nFaces, faceStream.data()); -#else - // this is a horrible substitute - // but avoids crashes when there is no vtkPolyhedron support - - // establish unique node ids used - HashSet> hashUniqId(2*256); - - forAll(cFaces, cFaceI) - { - const face& f = mesh.faces()[cFaces[cFaceI]]; - - forAll(f, fp) - { - hashUniqId.insert(f[fp]); - } - } - - // use face stream to store unique node ids: - faceStream = hashUniqId.sortedToc(); - - vtkmesh->InsertNextCell - ( - VTK_CONVEX_POINT_SET, - vtkIdType(faceStream.size()), - faceStream.data() - ); -#endif } else { diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt index 2b28dafd1a..78832c5759 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt @@ -46,13 +46,16 @@ QT4_WRAP_CPP(MOC_SRCS pqPVblockMeshReaderPanel.h) ADD_PARAVIEW_OBJECT_PANEL(IFACES IFACE_SRCS CLASS_NAME pqPVblockMeshReaderPanel - XML_NAME PVblockMeshReader # name of SourceProxy in *SM.xml + XML_NAME PVblockMeshReader # name of SourceProxy in *SM.xml XML_GROUP sources ) -IF("${PARAVIEW_VERSION_MINOR}" EQUAL 0) - ADD_PARAVIEW_PLUGIN( - PVblockMeshReader_SM "1.0" +# Separate GUI_RESOURCE_FILES deprecated with paraview 4.3 +# so check if version < 4.4 + +IF(("${PARAVIEW_VERSION_MAJOR}" LESS 5) AND ("${PARAVIEW_VERSION_MINOR}" LESS 4)) + ADD_PARAVIEW_PLUGIN( + PVblockMeshReader_SM "1.0" SERVER_MANAGER_XML PVblockMeshReader_SM.xml SERVER_MANAGER_SOURCES vtkPVblockMeshReader.cxx GUI_INTERFACES ${IFACES} @@ -60,16 +63,16 @@ IF("${PARAVIEW_VERSION_MINOR}" EQUAL 0) ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS} GUI_RESOURCE_FILES PVblockMeshReader.xml ) -ELSE("${PARAVIEW_VERSION_MINOR}" EQUAL 0) - ADD_PARAVIEW_PLUGIN( - PVblockMeshReader_SM "1.0" +ELSE() + ADD_PARAVIEW_PLUGIN( + PVblockMeshReader_SM "1.0" SERVER_MANAGER_XML PVblockMeshReader_SM.xml SERVER_MANAGER_SOURCES vtkPVblockMeshReader.cxx GUI_INTERFACES ${IFACES} GUI_SOURCES pqPVblockMeshReaderPanel.cxx ${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS} ) -ENDIF("${PARAVIEW_VERSION_MINOR}" EQUAL 0) +ENDIF() # Build the client-side plugin diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader.xml b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader.xml index 18413ee300..9354a13525 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader.xml +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader.xml @@ -1,4 +1,5 @@ + diff --git a/applications/utilities/postProcessing/miscellaneous/foamListTimes/foamListTimes.C b/applications/utilities/postProcessing/miscellaneous/foamListTimes/foamListTimes.C index 553f9f7f52..3e20143e1b 100644 --- a/applications/utilities/postProcessing/miscellaneous/foamListTimes/foamListTimes.C +++ b/applications/utilities/postProcessing/miscellaneous/foamListTimes/foamListTimes.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,6 +29,8 @@ Group Description List times using timeSelector. + To simplify parsing of the output, the normal banner information + is suppressed. Usage diff --git a/applications/utilities/postProcessing/noise/Allwmake b/applications/utilities/postProcessing/noise/Allwmake new file mode 100755 index 0000000000..84c6a2ac82 --- /dev/null +++ b/applications/utilities/postProcessing/noise/Allwmake @@ -0,0 +1,14 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \ + [ "${FFTW_ARCH_PATH##*-}" = system -a -f "/usr/include/fftw3.h" ] +then + wmake +else + echo + echo "Skipping noise utility (no FFTW)" + echo +fi + +#------------------------------------------------------------------------------ diff --git a/applications/utilities/postProcessing/noise/Make/options b/applications/utilities/postProcessing/noise/Make/options index b29b939580..2fc476e741 100644 --- a/applications/utilities/postProcessing/noise/Make/options +++ b/applications/utilities/postProcessing/noise/Make/options @@ -1,6 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/randomProcesses/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/surfMesh/lnInclude EXE_LIBS = \ -lrandomProcesses \ diff --git a/applications/utilities/postProcessing/noise/noise.C b/applications/utilities/postProcessing/noise/noise.C index 1b0ca07fec..4f9b1948a6 100644 --- a/applications/utilities/postProcessing/noise/noise.C +++ b/applications/utilities/postProcessing/noise/noise.C @@ -2,8 +2,8 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,157 +28,103 @@ Group grpPostProcessingUtilities Description - Utility to perform noise analysis of pressure data using the noiseFFT - library. + Utility to perform noise analysis of pressure data. - Control settings are read from the $FOAM_CASE/system/noiseDict dictionary, - or user-specified dictionary using the -dict option. Pressure data is - read using a CSV reader: + The utility provides a light wrapper around the run-time selectable + noise model. Current options include: + - point, and + - surface noise. - \heading Usage + \heading Example usage \verbatim - pRef 101325; - N 65536; - nw 100; - f1 25; - fU 10000; - graphFormat raw; + noiseModel surfaceNoise; // pointNoise - pressureData + surfaceNoiseCoeffs { - fileName "pressureData" - nHeaderLine 1; // number of header lines - refColumn 0; // reference column index - componentColumns (1); // component column indices - separator " "; // optional (defaults to ",") - mergeSeparators no; // merge multiple separators - outOfBounds clamp; // optional out-of-bounds handling - interpolationScheme linear; // optional interpolation scheme + windowModel Hanning; + + HanningCoeffs + { + // Window overlap percentage + overlapPercent 50; + symmetric yes; + extended yes; + + // Optional number of windows, default = all available + nWindow 5; + } + + + // Input file + inputFile "postProcessing/faceSource1/surface/patch/patch.case"; + + // Surface reader + reader ensight; + + // Surface writer + writer ensight; + + // Collate times for ensight output - ensures geometry is only written once + writeOptions + { + ensight + { + collateTimes true; + } + } + + // Number of samples in sampling window + // Must be a power of 2, default = 2^16 (=65536) + N 4096; + + // Write interval for FFT data, default = 1 + fftWriteInterval 100; } \endverbatim - where - \table - Property | Description | Required | Default value - pRef | Reference pressure | no | 0 - N | Number of samples in sampling window | no | 65536 - nw | Number of sampling windows | no | 100 - fl | Lower frequency band | no | 25 - fU | Upper frequency band | no | 10000 - graphFormat | Output graph format | no | raw - \endtable - - Current graph outputs include: - - FFT of the pressure data - - narrow-band PFL (pressure-fluctuation level) spectrum - - one-third-octave-band PFL spectrum - - one-third-octave-band pressure spectrum SeeAlso - CSV.H noiseFFT.H + noiseModel.H + windowModel.H \*---------------------------------------------------------------------------*/ - -#include "noiseFFT.H" #include "argList.H" #include "Time.H" -#include "functionObjectFile.H" -#include "CSV.H" +#include "noiseModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // using namespace Foam; -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -Foam::scalar checkUniformTimeStep(const scalarField& t) -{ - // check that a uniform time step has been applied - scalar deltaT = -1.0; - if (t.size() > 1) - { - for (label i = 1; i < t.size(); i++) - { - scalar dT = t[i] - t[i-1]; - if (deltaT < 0) - { - deltaT = dT; - } - - if (mag(deltaT - dT) > SMALL) - { - FatalErrorInFunction - << "Unable to process data with a variable time step" - << exit(FatalError); - } - } - } - else - { - FatalErrorInFunction - << "Unable to create FFT with a single value" - << exit(FatalError); - } - - return deltaT; -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { - argList::noParallel(); #include "addDictOption.H" #include "setRootCase.H" #include "createTime.H" - #include "createFields.H" - Info<< "Reading data file" << endl; - Function1Types::CSV pData("pressure", dict, "Data"); - - // time history data - const scalarField t(pData.x()); - - // pressure data - const scalarField p(pData.y()); - - if (t.size() < N) + fileName dictName(runTime.system()/"noiseDict"); + if (args.optionFound("dict")) { - FatalErrorInFunction - << "Block size N = " << N - << " is larger than number of data = " << t.size() - << exit(FatalError); + dictName = args["dict"]; } - Info<< " read " << t.size() << " values" << nl << endl; + IOdictionary dict + ( + IOobject + ( + dictName, + runTime, + IOobject::MUST_READ + ) + ); - - Info<< "Creating noise FFT" << endl; - noiseFFT nfft(checkUniformTimeStep(t), p); - - nfft -= pRef; - - fileName baseFileName(pData.fName().lessExt()); - - graph Pf(nfft.RMSmeanPf(N, min(nfft.size()/N, nw))); - Info<< " Creating graph for " << Pf.title() << endl; - Pf.write(baseFileName + graph::wordify(Pf.title()), graphFormat); - - graph Lf(nfft.Lf(Pf)); - Info<< " Creating graph for " << Lf.title() << endl; - Lf.write(baseFileName + graph::wordify(Lf.title()), graphFormat); - - graph Ldelta(nfft.Ldelta(Lf, f1, fU)); - Info<< " Creating graph for " << Ldelta.title() << endl; - Ldelta.write(baseFileName + graph::wordify(Ldelta.title()), graphFormat); - - graph Pdelta(nfft.Pdelta(Pf, f1, fU)); - Info<< " Creating graph for " << Pdelta.title() << endl; - Pdelta.write(baseFileName + graph::wordify(Pdelta.title()), graphFormat); + autoPtr model(noiseModel::New(dict)); + model->calculate(); Info<< nl << "End\n" << endl; diff --git a/applications/utilities/postProcessing/noise/noiseDict b/applications/utilities/postProcessing/noise/noiseDict new file mode 100644 index 0000000000..95eedffff1 --- /dev/null +++ b/applications/utilities/postProcessing/noise/noiseDict @@ -0,0 +1,136 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object noiseDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +noiseModel surfaceNoise; + +surfaceNoiseCoeffs +{ + windowModel Hanning; + + HanningCoeffs + { + // Window overlap percentage + overlapPercent 50; + symmetric yes; + extended yes; + + // Optional number of windows, default = all available + // nWindow 1; + } + +/* + windowModel uniform; + + uniformCoeffs + { + // Window overlap percentage + overlapPercent 50; + + value 1; + + // Optional number of windows, default = all available + // nWindow 1; + } +*/ + + + // Input file + inputFile "postProcessing/faceSource1/surface/patch_motorBike_rider-helmet%65/patch_motorBike_rider-helmet%65.case"; + + // Surface reader + reader ensight; + + // Surface writer + writer ensight; + + // Collate times for ensight output - ensures geometry is only written once + writeOptions + { + ensight + { + collateTimes true; + } + } + + // Reference density (to convert from kinematic to static pressure) + rhoRef 1.205; + + // Number of samples in sampling window + // Must be a power of 2, default = 2^16 (=65536) + N 4096; // 8192; // 4096; + + // Lower frequency limit, default = 25Hz + //fl 25; + + // Upper frequency limit, default = 10kHz + fu 15000; + + // Start time, default = 0s + //startTime 0; + + // Write interval for FFT data, default = 1 +// fftWriteInterval 100; +} + +pointNoiseCoeffs +{ + csvFileData + { + fileName "pressureData"; + nHeaderLine 1; + refColumn 0; + componentColumns (1); + separator " "; + mergeSeparators yes; + } + + HanningCoeffs + { + // Window overlap percentage + overlapPercent 50; + symmetric yes; + extended yes; + + // Optional number of windows, default = all available + //nWindow 5; + } + + // Graph format, default = raw + graphFormat raw; + + // Reference density (to convert from kinematic to static pressure) + rhoRef 1.2; + + // Number of samples in sampling window + // Must be a power of 2, default = 2^16 (=65536) + N 4096; + + // Lower frequency limit, default = 25Hz + //fl 25; + + // Upper frequency limit, default = 10kHz + //fu 10000; + + // Start time, default = 0s + //startTime 0; + + // Write interval for FFT data, default = 1 + fftWriteInterval 100; +} + + +// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/sampleDict b/applications/utilities/postProcessing/sampling/sample/sampleDict index 8e77428d6a..541911cfc0 100644 --- a/applications/utilities/postProcessing/sampling/sample/sampleDict +++ b/applications/utilities/postProcessing/sampling/sample/sampleDict @@ -71,7 +71,7 @@ formatOptions { // ascii/binary format format ascii; - //collateTimes true; // write single file containing multiple timesteps + collateTimes true; // write single file containing multiple timesteps // (only for static surfaces) } vtk diff --git a/applications/utilities/preProcessing/boxTurb/Allwmake b/applications/utilities/preProcessing/boxTurb/Allwmake new file mode 100755 index 0000000000..46d04eebf5 --- /dev/null +++ b/applications/utilities/preProcessing/boxTurb/Allwmake @@ -0,0 +1,14 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \ + [ "${FFTW_ARCH_PATH##*-}" = system -a -f "/usr/include/fftw3.h" ] +then + wmake +else + echo + echo "Skipping boxTurb utility (no FFTW)" + echo +fi + +#------------------------------------------------------------------------------ diff --git a/applications/utilities/surface/surfaceMeshInfo/surfaceMeshInfo.C b/applications/utilities/surface/surfaceMeshInfo/surfaceMeshInfo.C index 3ea27c4f8b..0bc6fb5992 100644 --- a/applications/utilities/surface/surfaceMeshInfo/surfaceMeshInfo.C +++ b/applications/utilities/surface/surfaceMeshInfo/surfaceMeshInfo.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,6 +29,8 @@ Group Description Miscellaneous information about surface meshes. + To simplify parsing of the output, the normal banner information + is suppressed. Usage - surfaceMeshInfo surfaceFile [OPTION] diff --git a/bin/engridFoam b/bin/engridFoam deleted file mode 100755 index 42acafdb65..0000000000 --- a/bin/engridFoam +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------ -# ========= | -# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox -# \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation -# \\/ 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 3 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, see . -# -# Script -# engridFoam -# -# Description -# start engrid using the paraview libraries from OpenFOAM -# -#------------------------------------------------------------------------------ -usage() { - exec 1>&2 - while [ "$#" -ge 1 ]; do echo "$1"; shift; done - cat< specify alternative case directory, default is the cwd -region specify alternative mesh region -touch only create the file (eg, .blockMesh, .OpenFOAM, etc) -touchAll create .blockMesh, .OpenFOAM files (and for all regions) + -vtk | -builtin use VTK builtin OpenFOAM reader (uses .foam extension) -help print the usage +Paraview options start with a double dashes. -paraview options start with a double dashes +* start paraview with the OpenFOAM libraries -* start paraview $ParaView_VERSION with the OpenFOAM libraries + paraview=$(command -v paraview) USAGE exit 1 @@ -67,10 +68,9 @@ unset regionName optTouch # already 2010-07) export LC_ALL=C -# Reader extension +# Reader extension and plugin extension=OpenFOAM - -requirePV=1 +plugin=PVFoamReader # Parse options while [ "$#" -gt 0 ] @@ -81,11 +81,12 @@ do ;; -block | -blockMesh) extension=blockMesh + plugin=PVblockMeshReader shift ;; - -builtin) + -builtin | -vtk) extension=foam - requirePV=0 + unset plugin shift ;; -case) @@ -100,12 +101,12 @@ do ;; -touch) optTouch=true - requirePV=0 + unset plugin shift ;; -touchAll) optTouch=all - requirePV=0 + unset plugin shift ;; --) @@ -116,26 +117,34 @@ do break # Stop here, treat this and balance as paraview options ;; *) - usage "unknown option/argument: '$*'" + usage "unknown option/argument: '$1'" ;; esac done -# Check that reader module has been built -if [ $requirePV -eq 1 -a ! -f $PV_PLUGIN_PATH/libPVFoamReader_SM.so ] -then - cat<< BUILDREADER - -FATAL ERROR: ParaView reader module libraries do not exist +# If a reader module is needed, check that it exists +[ -z "$plugin" -o -f $PV_PLUGIN_PATH/lib${plugin}_SM.so ] || { + cat<< BUILDREADER 1>&2 +ERROR: ParaView reader module library ($plugin) does not exist Please build the reader module before continuing: -cd \$FOAM_UTILITIES/postProcessing/graphics/PVReaders -./Allwclean -./Allwmake + + cd \$FOAM_UTILITIES/postProcessing/graphics/PVReaders + ./Allwclean + ./Allwmake BUILDREADER - exit 1 -fi + + # Fallback to native reader, if possible + if [ "$extension" = OpenFOAM ] + then + extension=foam + echo "Using the native VTK/OpenFOAM reader instead" 1>&2 + else + exit 1 + fi +} + # Check for --data=... argument hasDataArg() @@ -165,7 +174,7 @@ if [ -n "$regionName" ] then if [ ! -d constant/$regionName ] then - echo "FATAL ERROR: Region $regionName does not exist" + echo "FATAL ERROR: Region $regionName does not exist" 1>&2 exit 1 else caseFile="$caseName{$regionName}.$extension" @@ -179,10 +188,10 @@ all) if [ -f system/blockMeshDict -o -f constant/polyMesh/blockMeshDict ] then touch "$caseName.blockMesh" - echo "Created '$caseName.blockMesh'" + echo "Created '$caseName.blockMesh'" 1>&2 fi touch "$caseName.$extension" - echo "Created '$caseName.$extension'" + echo "Created '$caseName.$extension'" 1>&2 # Discover probable regions for region in constant/* do @@ -190,14 +199,14 @@ all) then regionName=${region##*/} touch "$caseName{$regionName}.$extension" - echo "Created '$caseName{$regionName}.$extension'" + echo "Created '$caseName{$regionName}.$extension'" 1>&2 fi done exit 0 ;; true) touch "$caseFile" - echo "Created '$caseFile'" + echo "Created '$caseFile'" 1>&2 exit 0 ;; esac @@ -222,14 +231,14 @@ else warn="WARN file does not exist:" case $extension in blockMesh) - blockMeshDictDir=system/blockMeshDict + blockMeshDict=system/blockMeshDict if [ -f constant/polyMesh/blockMeshDict ] then - blockMeshDictDir=constant/polyMesh/blockMeshDict + blockMeshDict=constant/polyMesh/blockMeshDict fi for check in \ system/controlDict \ - $blockMeshDictDir \ + $blockMeshDict \ ; do [ -s "$parentDir/$check" ] || { @@ -240,7 +249,7 @@ else done ;; - builtin | OpenFOAM) + OpenFOAM) for check in \ system/controlDict \ $fvControls/fvSchemes \ @@ -268,7 +277,7 @@ else [ -e $caseFile ] || { trap "rm -f $caseFile 2>/dev/null; exit 0" EXIT TERM INT touch "$caseFile" - echo "Created temporary '$caseFile'" + echo "Created temporary '$caseFile'" 1>&2 } # For now filter out any ld.so errors. Caused by non-system compiler? diff --git a/etc/config.csh/CGAL b/etc/config.csh/CGAL index 5371099a25..2fd06120eb 100644 --- a/etc/config.csh/CGAL +++ b/etc/config.csh/CGAL @@ -50,7 +50,7 @@ # #------------------------------------------------------------------------------ -set boost_version=boost-system +set boost_version=boost_1_61_0 set cgal_version=CGAL-4.8 setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version diff --git a/etc/config.csh/FFTW b/etc/config.csh/FFTW index 514216e1bf..78d24e17b1 100644 --- a/etc/config.csh/FFTW +++ b/etc/config.csh/FFTW @@ -48,7 +48,7 @@ # #------------------------------------------------------------------------------ -set fftw_version=fftw-system +set fftw_version=fftw-3.3.4 setenv FFTW_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$fftw_version diff --git a/etc/config.sh/CGAL b/etc/config.sh/CGAL index afb178d709..e23164d2c9 100644 --- a/etc/config.sh/CGAL +++ b/etc/config.sh/CGAL @@ -49,7 +49,7 @@ # - the LD_LIBRARY_PATH is not adjusted. #------------------------------------------------------------------------------ -boost_version=boost-system +boost_version=boost_1_61_0 cgal_version=CGAL-4.8 export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version diff --git a/etc/config.sh/FFTW b/etc/config.sh/FFTW index 74115fccfc..7c0a48861d 100644 --- a/etc/config.sh/FFTW +++ b/etc/config.sh/FFTW @@ -47,7 +47,7 @@ # - the LD_LIBRARY_PATH is not adjusted. #------------------------------------------------------------------------------ -fftw_version=fftw-system +fftw_version=fftw-3.3.4 export FFTW_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$fftw_version diff --git a/etc/config.sh/libccmio b/etc/config.sh/ccmio similarity index 98% rename from etc/config.sh/libccmio rename to etc/config.sh/ccmio index 1ef4205640..6bd6aa42ac 100644 --- a/etc/config.sh/libccmio +++ b/etc/config.sh/ccmio @@ -22,7 +22,7 @@ # along with OpenFOAM. If not, see . # # File -# etc/config.sh/libccmio +# etc/config.sh/ccmio # # Description # Setup file for libccmio include/libraries. diff --git a/etc/config.sh/functions b/etc/config.sh/functions index dcec6549d4..026755edc4 100644 --- a/etc/config.sh/functions +++ b/etc/config.sh/functions @@ -116,7 +116,7 @@ else # Cleanup environment: # ~~~~~~~~~~~~~~~~~~~~ unset WM_BASH_FUNCTIONS - unset _foamAddPath _foamAddLib _foamAddMan - unset _foamSource _foamEval + unset -f _foamAddPath _foamAddLib _foamAddMan + unset -f _foamSource _foamEval fi diff --git a/src/Allwmake b/src/Allwmake index e07067fb66..cc3d1b89b7 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -58,10 +58,9 @@ wmake $targetType sampling # Compile scotchDecomp, metisDecomp etc. parallel/Allwmake $targetType $* +randomProcesses/Allwmake $targetType $* wmake $targetType ODE -wmake $targetType randomProcesses - wmake $targetType fvMotionSolver transportModels/Allwmake $targetType $* diff --git a/src/conversion/Make/files b/src/conversion/Make/files index 7c5a0aa91c..b4a38476a1 100644 --- a/src/conversion/Make/files +++ b/src/conversion/Make/files @@ -1,5 +1,6 @@ ensight/file/ensightFile.C ensight/file/ensightGeoFile.C +ensight/readFile/ensightReadFile.C ensight/part/ensightPart.C ensight/part/ensightPartIO.C ensight/part/ensightPartCells.C diff --git a/src/conversion/ensight/file/ensightFile.C b/src/conversion/ensight/file/ensightFile.C index 700b39c014..05003b2a00 100644 --- a/src/conversion/ensight/file/ensightFile.C +++ b/src/conversion/ensight/file/ensightFile.C @@ -281,14 +281,15 @@ Foam::Ostream& Foam::ensightFile::writeKeyword(const keyType& key) { if (allowUndef_) { - write(string(key + " undef")); + write(string(static_cast(key) + " undef")); newline(); write(undefValue_); newline(); } else { - write(key); + // ensure we get ensightFile::write(const string&) + write(static_cast(key)); newline(); } return *this; diff --git a/src/conversion/ensight/file/ensightGeoFile.C b/src/conversion/ensight/file/ensightGeoFile.C index 9c0ceecdf9..c52aa79356 100644 --- a/src/conversion/ensight/file/ensightGeoFile.C +++ b/src/conversion/ensight/file/ensightGeoFile.C @@ -25,8 +25,6 @@ License #include "ensightGeoFile.H" -#include "IOstreams.H" - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::ensightGeoFile::initialize() @@ -76,10 +74,8 @@ Foam::ensightGeoFile::~ensightGeoFile() Foam::Ostream& Foam::ensightGeoFile::writeKeyword(const keyType& key) { - // Note: make sure to hit ensightFile::write(const string&) - write(string(key)); - - newline(); + // ensure we get ensightFile::write(const string&) + write(static_cast(key)); newline(); return *this; } diff --git a/src/conversion/ensight/readFile/ensightReadFile.C b/src/conversion/ensight/readFile/ensightReadFile.C new file mode 100644 index 0000000000..f73d95199e --- /dev/null +++ b/src/conversion/ensight/readFile/ensightReadFile.C @@ -0,0 +1,157 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2016 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 3 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, see . + +\*---------------------------------------------------------------------------*/ + +#include "ensightReadFile.H" +#include + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::ensightReadFile::ensightReadFile +( + const fileName& pathname, + IOstream::streamFormat format +) +: + IFstream(pathname, format) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::ensightReadFile::~ensightReadFile() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::Istream& Foam::ensightReadFile::read +( + char* buf, + std::streamsize count +) +{ + stdStream().read(buf, count); + return *this; +} + + +Foam::Istream& Foam::ensightReadFile::read(string& value) +{ + if (format() == IOstream::BINARY) + { + char buf[80]; + + read(reinterpret_cast(buf), sizeof(buf)); + + string strBuf(value); + + const size_t iEnd = strBuf.find('\0', 0); + if (iEnd == string::npos) + { + value = buf; + } + else + { + value = strBuf.substr(0, iEnd - 1); + } + } + else + { + value = ""; + while (value.empty() && !eof()) + { + getLine(value); + } + } + + return *this; +} + + +Foam::Istream& Foam::ensightReadFile::read(label& value) +{ + int ivalue; + + if (format() == IOstream::BINARY) + { + read + ( + reinterpret_cast(&ivalue), + sizeof(ivalue) + ); + } + else + { + stdStream() >> ivalue; + } + + value = ivalue; + return *this; +} + + +Foam::Istream& Foam::ensightReadFile::read(scalar& value) +{ + float fvalue; + + if (format() == IOstream::BINARY) + { + read + ( + reinterpret_cast(&fvalue), + sizeof(fvalue) + ); + + value = fvalue; + } + else + { + stdStream() >> value; + } + + return *this; +} + + +Foam::Istream& Foam::ensightReadFile::readKeyword(string& key) +{ + read(key); + return *this; +} + + +Foam::Istream& Foam::ensightReadFile::readBinaryHeader() +{ + if (format() == IOstream::BINARY) + { + string buffer; + read(buffer); + } + + return *this; +} + + +// ************************************************************************* // diff --git a/src/conversion/ensight/readFile/ensightReadFile.H b/src/conversion/ensight/readFile/ensightReadFile.H new file mode 100644 index 0000000000..aa6723352b --- /dev/null +++ b/src/conversion/ensight/readFile/ensightReadFile.H @@ -0,0 +1,110 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2016 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 3 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, see . + +Class + Foam::ensightReadFile + +Description + Ensight output with specialized read() for strings, integers and floats. + Correctly handles binary read as well. + +\*---------------------------------------------------------------------------*/ + +#ifndef ensightReadFile_H +#define ensightReadFile_H + +#include "IFstream.H" +#include "IOstream.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class ensightReadFile Declaration +\*---------------------------------------------------------------------------*/ + +class ensightReadFile +: + public IFstream +{ + // Private Member Functions + + //- Disallow default bitwise assignment + void operator=(const ensightReadFile&); + + //- Disallow default copy constructor + ensightReadFile(const ensightReadFile&); + + +public: + + // Constructors + + //- Construct from pathname + ensightReadFile + ( + const fileName& pathname, + IOstream::streamFormat format=IOstream::BINARY + ); + + + //- Destructor + ~ensightReadFile(); + + + // Output + + //- Inherit read from Istream + using Istream::read; + + //- Binary read + virtual Istream& read(char* buf, std::streamsize count); + + //- Read string as "%80s" or as binary + Istream& read(string& value); + + //- Read integer as "%10d" or as binary + Istream& read(label& value); + + //- Read float as "%12.5e" or as binary + Istream& read(scalar& value); + + //- Read element keyword + virtual Istream& readKeyword(string& key); + + //- Read "C Binary" for binary files (eg, geometry/measured) + Istream& readBinaryHeader(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentDFSEMInlet/turbulentDFSEMInletFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/turbulentDFSEMInlet/turbulentDFSEMInletFvPatchVectorField.C index 23eaed91eb..b0df476fe0 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentDFSEMInlet/turbulentDFSEMInletFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentDFSEMInlet/turbulentDFSEMInletFvPatchVectorField.C @@ -80,10 +80,14 @@ void Foam::turbulentDFSEMInletFvPatchVectorField::writeEddyOBJ() const // label i2 = ((i + 1) % nPoint) + nPoint; // os << "l " << i1 << " " << i2 << nl; //} - } + } { - OFstream os(db().time().path()/"eddies.obj"); + const Time& time = db().time(); + OFstream os + ( + time.path()/"eddies_" + Foam::name(time.timeIndex()) + ".obj" + ); label pointOffset = 0; forAll(eddies_, eddyI) @@ -91,7 +95,7 @@ void Foam::turbulentDFSEMInletFvPatchVectorField::writeEddyOBJ() const const eddy& e = eddies_[eddyI]; pointOffset += e.writeSurfaceOBJ(pointOffset, patchNormal_, os); } - } + } } @@ -137,7 +141,7 @@ void Foam::turbulentDFSEMInletFvPatchVectorField::writeLumleyCoeffs() const scalar eta = sqrt(-ii/3.0); os << xi << token::TAB << eta << token::TAB << ii << token::TAB << iii << endl; - } + } } // After interpolation @@ -1103,7 +1107,7 @@ void Foam::turbulentDFSEMInletFvPatchVectorField::write(Ostream& os) const writeEntryIfDifferent(os, "d", 1.0, d_); writeEntryIfDifferent(os, "kappa", 0.41, kappa_); writeEntryIfDifferent(os, "perturb", 1e-5, perturb_); - writeEntryIfDifferent(os, "nCellPerEddy", 5, nCellPerEddy_); + writeEntryIfDifferent