diff --git a/src/Allwmake b/src/Allwmake index c91fb6de5c..c7fbd7d2ca 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -79,6 +79,7 @@ functionObjects/Allwmake $targetType $* wmake $targetType lumpedPointMotion wmake $targetType sixDoFRigidBodyMotion +wmake $targetType sixDoFRigidBodyState wmake $targetType rigidBodyDynamics wmake $targetType rigidBodyMeshMotion diff --git a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C index 9732f9b70d..7da363f275 100644 --- a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C +++ b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.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 | Copyright (C) 2016-2017 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -647,7 +647,7 @@ Foam::sampledTriSurfaceMesh::sampledTriSurfaceMesh surfaceName, mesh.time().constant(), // instance "triSurface", // local - mesh, // registry + mesh.time(), // registry IOobject::MUST_READ, IOobject::NO_WRITE, false @@ -679,7 +679,7 @@ Foam::sampledTriSurfaceMesh::sampledTriSurfaceMesh dict.lookup("surface"), mesh.time().constant(), // instance "triSurface", // local - mesh, // registry + mesh.time(), // registry IOobject::MUST_READ, IOobject::NO_WRITE, false @@ -713,7 +713,7 @@ Foam::sampledTriSurfaceMesh::sampledTriSurfaceMesh name, mesh.time().constant(), // instance "triSurface", // local - mesh, // registry + mesh.time(), // registry IOobject::NO_READ, IOobject::NO_WRITE, false diff --git a/src/sampling/surface/triSurfaceMesh/discreteSurface.C b/src/sampling/surface/triSurfaceMesh/discreteSurface.C index 9ea6923748..d9165dd031 100644 --- a/src/sampling/surface/triSurfaceMesh/discreteSurface.C +++ b/src/sampling/surface/triSurfaceMesh/discreteSurface.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 | Copyright (C) 2016 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -642,7 +642,7 @@ Foam::discreteSurface::discreteSurface surfaceName, mesh.time().constant(), // instance "triSurface", // local - mesh, // registry + mesh.time(), // registry IOobject::MUST_READ, IOobject::NO_WRITE, false @@ -680,7 +680,7 @@ Foam::discreteSurface::discreteSurface dict.lookup("surface"), mesh.time().constant(), // instance "triSurface", // local - mesh, // registry + mesh.time(), // registry IOobject::MUST_READ, IOobject::NO_WRITE, false @@ -716,7 +716,7 @@ Foam::discreteSurface::discreteSurface name, mesh.time().constant(), // instance "triSurface", // local - mesh, // registry + mesh.time(), // registry IOobject::NO_READ, IOobject::NO_WRITE, false diff --git a/src/functionObjects/sixDoFRigidBodyState/Make/files b/src/sixDoFRigidBodyState/Make/files similarity index 100% rename from src/functionObjects/sixDoFRigidBodyState/Make/files rename to src/sixDoFRigidBodyState/Make/files diff --git a/src/functionObjects/sixDoFRigidBodyState/Make/options b/src/sixDoFRigidBodyState/Make/options similarity index 100% rename from src/functionObjects/sixDoFRigidBodyState/Make/options rename to src/sixDoFRigidBodyState/Make/options diff --git a/src/functionObjects/sixDoFRigidBodyState/sixDoFRigidBodyState.C b/src/sixDoFRigidBodyState/sixDoFRigidBodyState.C similarity index 61% rename from src/functionObjects/sixDoFRigidBodyState/sixDoFRigidBodyState.C rename to src/sixDoFRigidBodyState/sixDoFRigidBodyState.C index dd7dde334d..a77e0dc024 100644 --- a/src/functionObjects/sixDoFRigidBodyState/sixDoFRigidBodyState.C +++ b/src/sixDoFRigidBodyState/sixDoFRigidBodyState.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -46,6 +46,34 @@ namespace functionObjects } } +const Foam::Enum +< + Foam::functionObjects::sixDoFRigidBodyState::angleTypes +> +Foam::functionObjects::sixDoFRigidBodyState::angleTypeNames_ +{ + { angleTypes::RADIANS, "radians" }, + { angleTypes::DEGREES, "degrees" } +}; + + + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +void Foam::functionObjects::sixDoFRigidBodyState::writeFileHeader(Ostream& os) +{ + writeHeader(os, "Motion State"); + writeHeaderValue(os, "Angle Units", angleTypeNames_[angleFormat_]); + writeCommented(os, "Time"); + + os << tab + << "centreOfRotation" << tab + << "centreOfMass" << tab + << "rotation" << tab + << "velocity" << tab + << "omega" << endl; +} + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -57,10 +85,11 @@ Foam::functionObjects::sixDoFRigidBodyState::sixDoFRigidBodyState ) : fvMeshFunctionObject(name, runTime, dict), - logFiles(obr_, name) + writeFile(mesh_, name, typeName, dict), + angleFormat_(angleTypes::RADIANS) { read(dict); - resetName(typeName); + writeFileHeader(file()); } @@ -74,27 +103,20 @@ Foam::functionObjects::sixDoFRigidBodyState::~sixDoFRigidBodyState() bool Foam::functionObjects::sixDoFRigidBodyState::read(const dictionary& dict) { - fvMeshFunctionObject::read(dict); - angleFormat_ = dict.lookupOrDefault("angleFormat", "radians"); + if (fvMeshFunctionObject::read(dict)) + { + angleFormat_ = + angleTypeNames_.lookupOrDefault + ( + "angleFormat", + dict, + angleTypes::RADIANS + ); - return true; -} + return true; + } - -void Foam::functionObjects::sixDoFRigidBodyState::writeFileHeader(const label) -{ - OFstream& file = this->file(); - - writeHeader(file, "Motion State"); - writeHeaderValue(file, "Angle Units", angleFormat_); - writeCommented(file, "Time"); - - file<< tab - << "centreOfRotation" << tab - << "centreOfMass" << tab - << "rotation" << tab - << "velocity" << tab - << "omega" << endl; + return false; } @@ -106,26 +128,29 @@ bool Foam::functionObjects::sixDoFRigidBodyState::execute() bool Foam::functionObjects::sixDoFRigidBodyState::write() { - logFiles::write(); + const dynamicMotionSolverFvMesh& mesh = + refCast(obr_); - if (Pstream::master()) + const sixDoFRigidBodyMotionSolver& motionSolver_ = + refCast(mesh.motion()); + + const sixDoFRigidBodyMotion& motion = motionSolver_.motion(); + + vector rotationAngle + ( + quaternion(motion.orientation()).eulerAngles(quaternion::XYZ) + ); + + vector angularVelocity(motion.omega()); + + switch (angleFormat_) { - const dynamicMotionSolverFvMesh& mesh = - refCast(obr_); - - const sixDoFRigidBodyMotionSolver& motionSolver_ = - refCast(mesh.motion()); - - const sixDoFRigidBodyMotion& motion = motionSolver_.motion(); - - vector rotationAngle - ( - quaternion(motion.orientation()).eulerAngles(quaternion::XYZ) - ); - - vector angularVelocity(motion.omega()); - - if (angleFormat_ == "degrees") + case angleTypes::RADIANS: + { + // Nothing to do - already in radians + break; + } + case angleTypes::DEGREES: { rotationAngle.x() = radToDeg(rotationAngle.x()); rotationAngle.y() = radToDeg(rotationAngle.y()); @@ -134,18 +159,25 @@ bool Foam::functionObjects::sixDoFRigidBodyState::write() angularVelocity.x() = radToDeg(angularVelocity.x()); angularVelocity.y() = radToDeg(angularVelocity.y()); angularVelocity.z() = radToDeg(angularVelocity.z()); + break; + } + default: + { + FatalErrorInFunction + << "Unhandled enumeration " << angleTypeNames_[angleFormat_] + << abort(FatalError); } - - writeTime(file()); - file() - << tab - << motion.centreOfRotation() << tab - << motion.centreOfMass() << tab - << rotationAngle << tab - << motion.v() << tab - << angularVelocity << endl; } + writeTime(file()); + file() + << tab + << motion.centreOfRotation() << tab + << motion.centreOfMass() << tab + << rotationAngle << tab + << motion.v() << tab + << angularVelocity << endl; + return true; } diff --git a/src/functionObjects/sixDoFRigidBodyState/sixDoFRigidBodyState.H b/src/sixDoFRigidBodyState/sixDoFRigidBodyState.H similarity index 84% rename from src/functionObjects/sixDoFRigidBodyState/sixDoFRigidBodyState.H rename to src/sixDoFRigidBodyState/sixDoFRigidBodyState.H index 731a2909ed..e35e14044a 100644 --- a/src/functionObjects/sixDoFRigidBodyState/sixDoFRigidBodyState.H +++ b/src/sixDoFRigidBodyState/sixDoFRigidBodyState.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,7 +25,7 @@ Class Foam::functionObjects::sixDoFRigidBodyState Group - grpFieldFunctionObjects + grpSixDoFRigidBodyFunctionObjects Description Writes the 6-DoF motion state. @@ -49,7 +49,7 @@ Usage See also Foam::functionObjects::fvMeshFunctionObject - Foam::functionObjects::logFiles + Foam::functionObjects::writeFile SourceFiles sixDoFRigidBodyState.C @@ -60,7 +60,8 @@ SourceFiles #define sixDoFRigidBodyState_H #include "fvMeshFunctionObject.H" -#include "logFiles.H" +#include "writeFile.H" +#include "Enum.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -70,17 +71,27 @@ namespace functionObjects { /*---------------------------------------------------------------------------*\ - Class sixDoFRigidBodyState Declaration + Class sixDoFRigidBodyState Declaration \*---------------------------------------------------------------------------*/ class sixDoFRigidBodyState : public fvMeshFunctionObject, - public logFiles + public writeFile { // Private data - word angleFormat_; + enum class angleTypes + { + RADIANS, //!< Radians + DEGREES //!< Degrees + }; + + //- Angle type names + static const Enum angleTypeNames_; + + //- Angle format + angleTypes angleFormat_; // Private Member Functions @@ -96,8 +107,8 @@ protected: // Protected Member Functions - //- overloaded writeFileHeader from writeFile - virtual void writeFileHeader(const label i = 0); + //- Overloaded writeFileHeader from writeFile + virtual void writeFileHeader(Ostream& os); public: diff --git a/tutorials/IO/fileHandler/Allrun b/tutorials/IO/fileHandler/Allrun index 1f90a49f6b..52d50e93fa 100755 --- a/tutorials/IO/fileHandler/Allrun +++ b/tutorials/IO/fileHandler/Allrun @@ -2,6 +2,17 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions +if isTest $@ +then + # Reset the controlDict + if [ -f system/controlDict.orig ] + then + echo "$0: restoring the controlDict from controlDict.orig" + mv system/controlDict.orig system/controlDict + fi +fi + + runApplication blockMesh application=$(getApplication) diff --git a/tutorials/IO/fileHandler/Alltest b/tutorials/IO/fileHandler/Alltest deleted file mode 100755 index d5416642d4..0000000000 --- a/tutorials/IO/fileHandler/Alltest +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory -. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions - -# Reset the controlDict -if [ -f system/controlDict.orig ] -then - echo "$0: restoring the controlDict from controlDict.orig" - mv system/controlDict.orig system/controlDict -fi - -./Allrun - -#------------------------------------------------------------------------------ diff --git a/tutorials/basic/overPotentialFoam/cylinder/Allrun b/tutorials/basic/overPotentialFoam/cylinder/Allrun index 7604f9ad35..606384c249 100755 --- a/tutorials/basic/overPotentialFoam/cylinder/Allrun +++ b/tutorials/basic/overPotentialFoam/cylinder/Allrun @@ -5,4 +5,4 @@ (cd cylinderMesh && ./Allrun.pre) # Add background mesh -(cd cylinderAndBackground && ./Allrun) +(cd cylinderAndBackground && ./Allrun $*) diff --git a/tutorials/combustion/XiFoam/RAS/Allrun b/tutorials/combustion/XiFoam/RAS/Allrun index 213d7e0664..6871fc1cc2 100755 --- a/tutorials/combustion/XiFoam/RAS/Allrun +++ b/tutorials/combustion/XiFoam/RAS/Allrun @@ -4,55 +4,56 @@ cd ${0%/*} || exit 1 # Run from this directory setControlDict() { - sed \ - -e "s/\(deltaT[ \t]*\) 5e-06;/\1 1e-05;/g" \ - -e "s/\(endTime[ \t]*\) 0.005;/\1 0.015;/g" \ - -e "s/\(writeInterval[ \t]*\) 10;/\1 50;/g" \ - -i system/controlDict + foamDictionary -entry "deltaT" -set "1e-05" system/controlDict + foamDictionary -entry "endTime" -set "0.015" system/controlDict + foamDictionary -entry "writeInterval" -set "50" system/controlDict } setCombustionProperties() { - sed \ - -e "s/\(laminarFlameSpeedCorrelation[ \t]*\) Gulders;/\1 RaviPetersen;/g" \ - -e "s/\(fuel[ \t]*\) Propane;/\1 HydrogenInAir;/g" \ - -i constant/combustionProperties + foamDictionary -entry "laminarFlameSpeedCorrelation" \ + -set "RaviPetersen" constant/combustionProperties + foamDictionary -entry "fuel" \ + -set "HydrogenInAir" constant/combustionProperties } # Do moriyoshiHomogeneous ( cd moriyoshiHomogeneous && foamRunTutorials ) -# Clone case for second phase -cloneCase moriyoshiHomogeneous moriyoshiHomogeneousPart2 +if ! isTest $@ +then + # Clone case for second phase + cloneCase moriyoshiHomogeneous moriyoshiHomogeneousPart2 -# Modify and execute -( - cd moriyoshiHomogeneousPart2 || exit + # Modify and execute + ( + cd moriyoshiHomogeneousPart2 || exit - # The following 2 command lines are a generic implementation of the - # following command: - # cp -r ../moriyoshiHomogeneous/0.005 . + # The following 2 command lines are a generic implementation of the + # following command: + # cp -r ../moriyoshiHomogeneous/0.005 . - lastTimeStep=$(foamListTimes -case ../moriyoshiHomogeneous -latestTime) - cp -r ../moriyoshiHomogeneous/$lastTimeStep . + lastTimeStep=$(foamListTimes -case ../moriyoshiHomogeneous -latestTime) + cp -r ../moriyoshiHomogeneous/$lastTimeStep . - setControlDict - runApplication $(getApplication) -) + setControlDict + runApplication $(getApplication) + ) -# Clone case for hydrogen -cloneCase moriyoshiHomogeneous moriyoshiHomogeneousHydrogen + # Clone case for hydrogen + cloneCase moriyoshiHomogeneous moriyoshiHomogeneousHydrogen -# Modify and execute -( - cd moriyoshiHomogeneousHydrogen || exit + # Modify and execute + ( + cd moriyoshiHomogeneousHydrogen || exit - setCombustionProperties - mv constant/thermophysicalProperties \ - constant/thermophysicalProperties.propane - mv constant/thermophysicalProperties.hydrogen \ - constant/thermophysicalProperties - runApplication $(getApplication) -) + setCombustionProperties + mv constant/thermophysicalProperties \ + constant/thermophysicalProperties.propane + mv constant/thermophysicalProperties.hydrogen \ + constant/thermophysicalProperties + runApplication $(getApplication) + ) +fi #------------------------------------------------------------------------------ diff --git a/tutorials/combustion/chemFoam/gri/Allrun b/tutorials/combustion/chemFoam/gri/Allrun index 192618695d..822fbd8972 100755 --- a/tutorials/combustion/chemFoam/gri/Allrun +++ b/tutorials/combustion/chemFoam/gri/Allrun @@ -9,6 +9,9 @@ runApplication chemkinToFoam \ runApplication $(getApplication) -(cd validation && ./Allrun $*) +if ! isTest $@ +then + (cd validation && ./Allrun $*) +fi #------------------------------------------------------------------------------ diff --git a/tutorials/combustion/chemFoam/h2/Allrun b/tutorials/combustion/chemFoam/h2/Allrun index bf06d218a8..d0f65aed57 100755 --- a/tutorials/combustion/chemFoam/h2/Allrun +++ b/tutorials/combustion/chemFoam/h2/Allrun @@ -4,6 +4,9 @@ cd ${0%/*} || exit 1 # Run from this directory runApplication $(getApplication) -(cd validation && ./Allrun $*) +if ! isTest $@ +then + (cd validation && ./Allrun $*) +fi #------------------------------------------------------------------------------ diff --git a/tutorials/combustion/chemFoam/ic8h18/Allrun b/tutorials/combustion/chemFoam/ic8h18/Allrun index bf06d218a8..d0f65aed57 100755 --- a/tutorials/combustion/chemFoam/ic8h18/Allrun +++ b/tutorials/combustion/chemFoam/ic8h18/Allrun @@ -4,6 +4,9 @@ cd ${0%/*} || exit 1 # Run from this directory runApplication $(getApplication) -(cd validation && ./Allrun $*) +if ! isTest $@ +then + (cd validation && ./Allrun $*) +fi #------------------------------------------------------------------------------ diff --git a/tutorials/combustion/chemFoam/ic8h18_TDAC/Allrun b/tutorials/combustion/chemFoam/ic8h18_TDAC/Allrun index bf06d218a8..d0f65aed57 100755 --- a/tutorials/combustion/chemFoam/ic8h18_TDAC/Allrun +++ b/tutorials/combustion/chemFoam/ic8h18_TDAC/Allrun @@ -4,6 +4,9 @@ cd ${0%/*} || exit 1 # Run from this directory runApplication $(getApplication) -(cd validation && ./Allrun $*) +if ! isTest $@ +then + (cd validation && ./Allrun $*) +fi #------------------------------------------------------------------------------ diff --git a/tutorials/combustion/chemFoam/nc7h16/Allrun b/tutorials/combustion/chemFoam/nc7h16/Allrun index bf06d218a8..d0f65aed57 100755 --- a/tutorials/combustion/chemFoam/nc7h16/Allrun +++ b/tutorials/combustion/chemFoam/nc7h16/Allrun @@ -4,6 +4,9 @@ cd ${0%/*} || exit 1 # Run from this directory runApplication $(getApplication) -(cd validation && ./Allrun $*) +if ! isTest $@ +then + (cd validation && ./Allrun $*) +fi #------------------------------------------------------------------------------ diff --git a/tutorials/combustion/fireFoam/LES/compartmentFire/Allrun b/tutorials/combustion/fireFoam/LES/compartmentFire/Allrun index c09ed1e6e3..7916c6e143 100755 --- a/tutorials/combustion/fireFoam/LES/compartmentFire/Allrun +++ b/tutorials/combustion/fireFoam/LES/compartmentFire/Allrun @@ -21,6 +21,9 @@ runParallel $(getApplication) paraFoam -touch paraFoam -touch -region panelRegion -(cd validation && ./createGraphs) +if ! isTest $@ +then + (cd validation && ./createGraphs) +fi #------------------------------------------------------------------------------ diff --git a/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/Allrun b/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/Allrun index 6299aedeab..37f0be5d56 100755 --- a/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/Allrun +++ b/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/Allrun @@ -5,8 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory # Application name application=$(getApplication) -rm -f 0 -cp -r 0.orig 0 +restore0Dir runApplication chemkinToFoam \ chemkin/grimech30.dat chemkin/thermo30.dat chemkin/transportProperties \ @@ -15,20 +14,27 @@ runApplication chemkinToFoam \ runApplication blockMesh runApplication setFields +if isTest $@ +then + # Test without chemistry + foamDictionary -entry "chemistry" -set "off" constant/chemistryProperties + runApplication $application +else + # Run the application without chemistry until 1500 to let the flow field + # develop + foamDictionary -entry "writeInterval" -set "1500" system/controlDict + foamDictionary -entry "endTime" -set "1500" system/controlDict + foamDictionary -entry "chemistry" -set "off" constant/chemistryProperties -# Run the application without chemistry until 1500 to let the flow field develop -foamDictionary -entry "writeInterval" -set "1500" system/controlDict -foamDictionary -entry "endTime" -set "1500" system/controlDict -foamDictionary -entry "chemistry" -set "off" constant/chemistryProperties - -runApplication $application + runApplication $application -# Run with chemistry until flame reach its full size -foamDictionary -entry "writeInterval" -set "100" system/controlDict -foamDictionary -entry "endTime" -set "5000" system/controlDict -foamDictionary -entry "chemistry" -set "on" constant/chemistryProperties + # Run with chemistry until flame reach its full size + foamDictionary -entry "writeInterval" -set "100" system/controlDict + foamDictionary -entry "endTime" -set "5000" system/controlDict + foamDictionary -entry "chemistry" -set "on" constant/chemistryProperties -runApplication -o $application + runApplication -o $application +fi #------------------------------------------------------------------------------ diff --git a/tutorials/compressible/overRhoSimpleFoam/hotCylinder/Allrun b/tutorials/compressible/overRhoSimpleFoam/hotCylinder/Allrun index 7604f9ad35..606384c249 100755 --- a/tutorials/compressible/overRhoSimpleFoam/hotCylinder/Allrun +++ b/tutorials/compressible/overRhoSimpleFoam/hotCylinder/Allrun @@ -5,4 +5,4 @@ (cd cylinderMesh && ./Allrun.pre) # Add background mesh -(cd cylinderAndBackground && ./Allrun) +(cd cylinderAndBackground && ./Allrun $*) diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/Allrun b/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/Allrun index 8143eddba2..63008fb093 100755 --- a/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/Allrun +++ b/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/Allrun @@ -29,20 +29,23 @@ run resolved # Run with the plenum modelled by a boundary condition run modelled -# Plot a comparison of the pressure in the neck -cat << EOF | gnuplot -persist +if ! isTest $@ +then + # Plot a comparison of the pressure in the neck + cat << EOF | gnuplot -persist -set terminal postscript eps size 5,4 enhanced color + set terminal postscript eps size 5,4 enhanced color -set xlabel "Time (s)" -set ylabel "Guage pressure in the neck (Pa)" + set xlabel "Time (s)" + set ylabel "Guage pressure in the neck (Pa)" -set output "pressure.eps" + set output "pressure.eps" -plot \ - "resolved/postProcessing/probes/0/p" us 1:(\$4-1e5) t "Resolved Plenum" w l, \ - "modelled/postProcessing/probes/0/p" us 1:(\$4-1e5) t "Modelled Plenum" w l + plot \ + "resolved/postProcessing/probes/0/p" us 1:(\$4-1e5) t "Resolved Plenum" w l, \ + "modelled/postProcessing/probes/0/p" us 1:(\$4-1e5) t "Modelled Plenum" w l EOF +fi #------------------------------------------------------------------------------ diff --git a/tutorials/compressible/sonicLiquidFoam/Allrun b/tutorials/compressible/sonicLiquidFoam/Allrun index f7f2c64c04..81160eeefc 100755 --- a/tutorials/compressible/sonicLiquidFoam/Allrun +++ b/tutorials/compressible/sonicLiquidFoam/Allrun @@ -26,18 +26,21 @@ setDecompressionTankFine() # Do decompressionTank ( cd decompressionTank && foamRunTutorials ) -# Clone case -cloneCase decompressionTank decompressionTankFine +if ! isTest $@ +then + # Clone case + cloneCase decompressionTank decompressionTankFine -( - cd decompressionTankFine || exit + ( + cd decompressionTankFine || exit - # Modify case - setDecompressionTankFine + # Modify case + setDecompressionTankFine - # And execute - runApplication blockMesh - runApplication $(getApplication) -) + # And execute + runApplication blockMesh + runApplication $(getApplication) + ) +fi #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allrun b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allrun index 4abae23d19..e36ed26058 100755 --- a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allrun +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/Allrun @@ -6,6 +6,9 @@ runApplication blockMesh runApplication $(getApplication) runApplication -s sample postProcess -latestTime -func sample -runApplication validation/createGraphs +if ! istest $@ +then + runApplication validation/createGraphs +fi #------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun index 0a453a0279..03f8f41f8f 100755 --- a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun +++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun @@ -32,37 +32,39 @@ do rm -rf logs done +if ! isTest $@ +then + # create validation plot + # Test if gnuplot exists on the system + command -v gnuplot >/dev/null 2>&1 || { + echo "gnuplot not found - skipping graph creation" 1>&2 + exit 1 + } -# create validation plot -# Test if gnuplot exists on the system -command -v gnuplot >/dev/null 2>&1 || { - echo "gnuplot not found - skipping graph creation" 1>&2 - exit 1 -} + graphName="OF_vs_ANALYTICAL.eps" -graphName="OF_vs_ANALYTICAL.eps" - -echo "Creating graph of u+ vs y+ to $graphName" -gnuplot< system/blockMeshDict - -runApplication blockMesh - -restore0Dir - -runApplication decomposePar - -runParallel $(getApplication) - -# Note: not running the noise utility since no pressure data will be generated - -#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/interFoam/RAS/damBreak/Allrun b/tutorials/multiphase/interFoam/RAS/damBreak/Allrun index 5588e4ecd0..aab521bd82 100755 --- a/tutorials/multiphase/interFoam/RAS/damBreak/Allrun +++ b/tutorials/multiphase/interFoam/RAS/damBreak/Allrun @@ -24,21 +24,25 @@ setDamBreakFine () # Do damBreak (cd damBreak && foamRunTutorials) -# Clone case -cloneCase damBreak damBreakFine -( - cd damBreakFine || exit +if ! isTest $@ +then + # Clone case + cloneCase damBreak damBreakFine - # Modify case - setDamBreakFine - \cp ../damBreak/0/alpha.water.orig 0/alpha.water - # And execute - runApplication blockMesh - runApplication setFields - runApplication decomposePar - runParallel $(getApplication) - runApplication reconstructPar -) + ( + cd damBreakFine || exit + + # Modify case + setDamBreakFine + \cp ../damBreak/0/alpha.water.orig 0/alpha.water + # And execute + runApplication blockMesh + runApplication setFields + runApplication decomposePar + runParallel $(getApplication) + runApplication reconstructPar + ) +fi #------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/Allrun b/tutorials/multiphase/interFoam/laminar/damBreak/Allrun index 5588e4ecd0..91244246c5 100755 --- a/tutorials/multiphase/interFoam/laminar/damBreak/Allrun +++ b/tutorials/multiphase/interFoam/laminar/damBreak/Allrun @@ -24,21 +24,24 @@ setDamBreakFine () # Do damBreak (cd damBreak && foamRunTutorials) -# Clone case -cloneCase damBreak damBreakFine +if ! isTest $@ +then + # Clone case + cloneCase damBreak damBreakFine -( - cd damBreakFine || exit + ( + cd damBreakFine || exit - # Modify case - setDamBreakFine - \cp ../damBreak/0/alpha.water.orig 0/alpha.water - # And execute - runApplication blockMesh - runApplication setFields - runApplication decomposePar - runParallel $(getApplication) - runApplication reconstructPar -) + # Modify case + setDamBreakFine + \cp ../damBreak/0/alpha.water.orig 0/alpha.water + # And execute + runApplication blockMesh + runApplication setFields + runApplication decomposePar + runParallel $(getApplication) + runApplication reconstructPar + ) +fi #------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/Allrun b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/Allrun index a9796a5b0f..a7486bdf95 100755 --- a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/Allrun +++ b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/Allrun @@ -2,8 +2,13 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions -(cd eulerianInjection && ./Allrun) -(cd lagrangianParticleInjection && ./Allrun) -(cd lagrangianDistributionInjection && ./Allrun) +(cd eulerianInjection && ./Allrun $*) + +if ! isTest $@ +then + # Note: particle data only available if running complete case + (cd lagrangianParticleInjection && ./Allrun $*) + (cd lagrangianDistributionInjection && ./Allrun $*) +fi #------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/Alltest b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/Alltest deleted file mode 100755 index e1e7226b22..0000000000 --- a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/Alltest +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory -. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions - -(cd eulerianInjection && ./Allrun) - -# Note: only running the Eulerian test - particle data not yet available -# (after 1 iter) for subsequent Lagrangian cases - -#------------------------------------------------------------------------------ diff --git a/tutorials/verificationAndValidation/schemes/divergenceExample/Allrun b/tutorials/verificationAndValidation/schemes/divergenceExample/Allrun index c15cbc2e04..19627902c5 100755 --- a/tutorials/verificationAndValidation/schemes/divergenceExample/Allrun +++ b/tutorials/verificationAndValidation/schemes/divergenceExample/Allrun @@ -4,6 +4,8 @@ cd ${0%/*} || exit 1 # run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions +params=$@ + runApplication blockMesh cat system/schemesToTest | while read scheme @@ -16,6 +18,9 @@ do runApplication -s ${schemeTag} scalarTransportFoam - # Save the line plot - mv postProcessing/sample1/100/line1_T.xy line1_T_${schemeTag}.xy + if ! isTest $params + then + # Save the line plot + mv postProcessing/sample1/100/line1_T.xy line1_T_${schemeTag}.xy + fi done