diff --git a/applications/solvers/combustion/fireFoam/Make/options b/applications/solvers/combustion/fireFoam/Make/options index 01ebf2218b..9f7a66b39e 100644 --- a/applications/solvers/combustion/fireFoam/Make/options +++ b/applications/solvers/combustion/fireFoam/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ - -I./combustionModels/lnInclude \ + -IcombustionModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ diff --git a/applications/solvers/combustion/fireFoam/UEqn.H b/applications/solvers/combustion/fireFoam/UEqn.H index a77c262831..c4a865300d 100644 --- a/applications/solvers/combustion/fireFoam/UEqn.H +++ b/applications/solvers/combustion/fireFoam/UEqn.H @@ -7,15 +7,18 @@ fvVectorMatrix UEqn UEqn.relax(); -solve -( - UEqn - == - fvc::reconstruct +if (pimple.momentumPredictor()) +{ + solve ( + UEqn + == + fvc::reconstruct ( - - ghf*fvc::snGrad(rho) - - fvc::snGrad(p_rgh) - )*mesh.magSf() - ) -); + ( + - ghf*fvc::snGrad(rho) + - fvc::snGrad(p_rgh) + )*mesh.magSf() + ) + ); +} diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/files b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/files index 7e253a8b32..8e2cf71dcc 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/files +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/files @@ -1,4 +1,3 @@ -turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C LIB = $(FOAM_LIBBIN)/libcoupledDerivedFvPatchFields diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C index 03d932975f..66788946a4 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C @@ -202,7 +202,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() return; } - if(oldMode_ == fixedHeatFlux) + if (oldMode_ == fixedHeatFlux) { this->refGrad() = q_/K(*this); this->refValue() = 0.0; diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H index 4156f784d6..2df7613542 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H @@ -54,8 +54,6 @@ SourceFiles #ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H #define solidWallHeatFluxTemperatureFvPatchScalarField_H -//#include "fixedGradientFvPatchFields.H" - #include "mixedFvPatchFields.H" #include "temperatureCoupledBase.H" diff --git a/applications/solvers/lagrangian/reactingParcelFilmPyrolysisFoam/YhsEqn.H b/applications/solvers/lagrangian/reactingParcelFilmPyrolysisFoam/YhsEqn.H index ae70f37d8c..7606d9ce72 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmPyrolysisFoam/YhsEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmPyrolysisFoam/YhsEqn.H @@ -21,7 +21,7 @@ tmp > mvConvection volScalarField& Yi = Y[i]; fvScalarMatrix R = combustion->R(Yi); - solve + fvScalarMatrix YiEqn ( fvm::ddt(rho, Yi) + mvConvection->fvmDiv(phi, Yi) @@ -29,10 +29,12 @@ tmp > mvConvection == parcels.SYi(i, Yi) + surfaceFilm.Srho(i) - + R, - mesh.solver("Yi") + + R ); + YiEqn.relax(); + YiEqn.solve(mesh.solver("Yi")); + Yi.max(0.0); Yt += Yi; } diff --git a/applications/solvers/lagrangian/reactingParcelFilmPyrolysisFoam/reactingParcelFilmPyrolysisFoam.C b/applications/solvers/lagrangian/reactingParcelFilmPyrolysisFoam/reactingParcelFilmPyrolysisFoam.C index 6a46b2fbfb..ac029bea86 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmPyrolysisFoam/reactingParcelFilmPyrolysisFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFilmPyrolysisFoam/reactingParcelFilmPyrolysisFoam.C @@ -25,7 +25,7 @@ Application reactingParcelFilmPyrolysisFoam Description - Transient PISO solver for compressible, laminar or turbulent flow with + Transient PIMPLE solver for Fires and turbulent diffusion flames with reacting Lagrangian parcels, surface film and pyrolysis modelling. \*---------------------------------------------------------------------------*/ diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C index 459eaa0cef..b4c6020e1b 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C @@ -1302,13 +1302,32 @@ int main(int argc, char *argv[]) if (oneD) { // Reuse single empty patch. - word patchName = "oneDWedgePatch"; - - zoneSidePatch[zoneI] = addPatch - ( - mesh, - patchName - ); + word patchType = dict.lookup("oneDPolyPatchType"); + word patchName; + if (patchType == "emptyPolyPatch") + { + patchName = "oneDEmptyPatch"; + zoneSidePatch[zoneI] = addPatch + ( + mesh, + patchName + ); + } + else if (patchType == "wedgePolyPatch") + { + patchName = "oneDWedgePatch"; + zoneSidePatch[zoneI] = addPatch + ( + mesh, + patchName + ); + } + else + { + FatalErrorIn(args.executable()) + << "Type " << patchType << " does not exist " + << exit(FatalError); + } Info<< zoneSidePatch[zoneI] << '\t' << patchName << nl; @@ -1427,6 +1446,10 @@ int main(int argc, char *argv[]) { ePatches[i] = zoneSidePatch[zoneID[eFaces[i]]]; } + if (eFaces.size() != 2) + { + nonManifoldEdge[edgeI] = 1; + } } else if (eFaces.size() == 2) { diff --git a/bin/tools/RunFunctions b/bin/tools/RunFunctions index bfaf58c39c..bc5ebb5f32 100644 --- a/bin/tools/RunFunctions +++ b/bin/tools/RunFunctions @@ -61,7 +61,14 @@ runParallel() nProcs=$1 shift echo "Running $APP_RUN in parallel on $PWD using $nProcs processes" - ( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 ) + + if [ "$WM_SCHEDULER" ] + then + echo "$PWD: $WM_SCHEDULER -np $nProcs" 1>&2 + $WM_SCHEDULER -np $nProcs "( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 )" + else + ( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 ) + fi fi } diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 817381be61..0409816fa5 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -120,6 +120,7 @@ $(derivedFvPatchFields)/directMappedFixedInternalValue/directMappedFixedInternal $(derivedFvPatchFields)/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C $(derivedFvPatchFields)/directMappedFixedValue/directMappedFixedValueFvPatchFields.C $(derivedFvPatchFields)/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C +$(derivedFvPatchFields)/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.C $(derivedFvPatchFields)/fan/fanFvPatchFields.C $(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C diff --git a/src/regionModels/pyrolysisModels/derivedFvPatchFields/flowRateInletVelocityCoupled/flowRateInletVelocityCoupledFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.C similarity index 75% rename from src/regionModels/pyrolysisModels/derivedFvPatchFields/flowRateInletVelocityCoupled/flowRateInletVelocityCoupledFvPatchVectorField.C rename to src/finiteVolume/fields/fvPatchFields/derived/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.C index cdfb8d7739..3bc74d3e05 100644 --- a/src/regionModels/pyrolysisModels/derivedFvPatchFields/flowRateInletVelocityCoupled/flowRateInletVelocityCoupledFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.C @@ -23,20 +23,18 @@ License \*---------------------------------------------------------------------------*/ -#include "flowRateInletVelocityCoupledFvPatchVectorField.H" +#include "directMappedFlowRateFvPatchVectorField.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "directMappedPatchBase.H" #include "mapDistribute.H" -#include "regionProperties.H" -#include "basicThermo.H" #include "surfaceFields.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::flowRateInletVelocityCoupledFvPatchVectorField:: -flowRateInletVelocityCoupledFvPatchVectorField +Foam::directMappedFlowRateFvPatchVectorField:: +directMappedFlowRateFvPatchVectorField ( const fvPatch& p, const DimensionedField& iF @@ -49,10 +47,10 @@ flowRateInletVelocityCoupledFvPatchVectorField {} -Foam::flowRateInletVelocityCoupledFvPatchVectorField:: -flowRateInletVelocityCoupledFvPatchVectorField +Foam::directMappedFlowRateFvPatchVectorField:: +directMappedFlowRateFvPatchVectorField ( - const flowRateInletVelocityCoupledFvPatchVectorField& ptf, + const directMappedFlowRateFvPatchVectorField& ptf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper @@ -65,8 +63,8 @@ flowRateInletVelocityCoupledFvPatchVectorField {} -Foam::flowRateInletVelocityCoupledFvPatchVectorField:: -flowRateInletVelocityCoupledFvPatchVectorField +Foam::directMappedFlowRateFvPatchVectorField:: +directMappedFlowRateFvPatchVectorField ( const fvPatch& p, const DimensionedField& iF, @@ -80,10 +78,10 @@ flowRateInletVelocityCoupledFvPatchVectorField {} -Foam::flowRateInletVelocityCoupledFvPatchVectorField:: -flowRateInletVelocityCoupledFvPatchVectorField +Foam::directMappedFlowRateFvPatchVectorField:: +directMappedFlowRateFvPatchVectorField ( - const flowRateInletVelocityCoupledFvPatchVectorField& ptf + const directMappedFlowRateFvPatchVectorField& ptf ) : fixedValueFvPatchField(ptf), @@ -93,10 +91,10 @@ flowRateInletVelocityCoupledFvPatchVectorField {} -Foam::flowRateInletVelocityCoupledFvPatchVectorField:: -flowRateInletVelocityCoupledFvPatchVectorField +Foam::directMappedFlowRateFvPatchVectorField:: +directMappedFlowRateFvPatchVectorField ( - const flowRateInletVelocityCoupledFvPatchVectorField& ptf, + const directMappedFlowRateFvPatchVectorField& ptf, const DimensionedField& iF ) : @@ -109,7 +107,7 @@ flowRateInletVelocityCoupledFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs() +void Foam::directMappedFlowRateFvPatchVectorField::updateCoeffs() { if (updated()) { @@ -127,35 +125,19 @@ void Foam::flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs() nbrMesh ).boundary()[mpp.samplePolyPatch().index()]; - // Force recalculation of mapping and schedule - const mapDistribute& distMap = mpp.map(); - scalarList phi = nbrPatch.lookupPatchField(nbrPhiName_); - mapDistribute::distribute - ( - Pstream::defaultCommsType, - distMap.schedule(), - distMap.constructSize(), - distMap.subMap(), // what to send - distMap.constructMap(), // what to receive - phi - ); + mpp.map().distribute(phi); + const surfaceScalarField& phiName = db().lookupObject(phiName_); - - // a simpler way of doing this would be nice - //scalar avgU = -flowRate_/gSum(patch().magSf()); scalarField U = -phi/patch().magSf(); vectorField n = patch().nf(); -// const surfaceScalarField& phi = -// db().lookupObject(phiName_); - if (phiName.dimensions() == dimVelocity*dimArea) { // volumetric flow-rate @@ -186,7 +168,7 @@ void Foam::flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs() { FatalErrorIn ( - "flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs()" + "directMappedFlowRateFvPatchVectorField::updateCoeffs()" ) << "dimensions of " << phiName_ << " are incorrect" << nl << " on patch " << this->patch().name() << " of field " << this->dimensionedInternalField().name() @@ -198,7 +180,7 @@ void Foam::flowRateInletVelocityCoupledFvPatchVectorField::updateCoeffs() } -void Foam::flowRateInletVelocityCoupledFvPatchVectorField::write +void Foam::directMappedFlowRateFvPatchVectorField::write ( Ostream& os ) const @@ -218,7 +200,7 @@ namespace Foam makePatchTypeField ( fvPatchVectorField, - flowRateInletVelocityCoupledFvPatchVectorField + directMappedFlowRateFvPatchVectorField ); } diff --git a/src/regionModels/pyrolysisModels/derivedFvPatchFields/flowRateInletVelocityCoupled/flowRateInletVelocityCoupledFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.H similarity index 77% rename from src/regionModels/pyrolysisModels/derivedFvPatchFields/flowRateInletVelocityCoupled/flowRateInletVelocityCoupledFvPatchVectorField.H rename to src/finiteVolume/fields/fvPatchFields/derived/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.H index fcc252da1c..6ec8cac5fd 100644 --- a/src/regionModels/pyrolysisModels/derivedFvPatchFields/flowRateInletVelocityCoupled/flowRateInletVelocityCoupledFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedFlowRate/directMappedFlowRateFvPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2006-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::flowRateInletVelocityCoupledFvPatchVectorField + Foam::directMappedFlowRateFvPatchVectorField Description Describes a volumetric/mass flow normal vector boundary condition by its @@ -41,7 +41,7 @@ Description @verbatim inlet { - type flowRateInletVelocityCoupled; + type directMappedFlowRate; phi phi; rho rho; neigPhi neigPhiName_; // Volumetric/mass flow rate @@ -50,18 +50,13 @@ Description } @endverbatim -Note - - The value is positive inwards - - May not work correctly for transonic inlets - - Strange behaviour with potentialFoam since the U equation is not solved - SourceFiles - flowRateInletVelocityCoupledFvPatchVectorField.C + directMappedFlowRateFvPatchVectorField.C \*---------------------------------------------------------------------------*/ -#ifndef flowRateInletVelocityCoupledFvPatchVectorField_H -#define flowRateInletVelocityCoupledFvPatchVectorField_H +#ifndef directMappedFlowRateFvPatchVectorField_H +#define directMappedFlowRateFvPatchVectorField_H #include "fixedValueFvPatchFields.H" @@ -73,7 +68,7 @@ namespace Foam Class flowRateInletVelocityFvPatch Declaration \*---------------------------------------------------------------------------*/ -class flowRateInletVelocityCoupledFvPatchVectorField +class directMappedFlowRateFvPatchVectorField : public fixedValueFvPatchVectorField { @@ -92,20 +87,20 @@ class flowRateInletVelocityCoupledFvPatchVectorField public: //- Runtime type information - TypeName("flowRateInletVelocityCoupled"); + TypeName("directMappedFlowRate"); // Constructors //- Construct from patch and internal field - flowRateInletVelocityCoupledFvPatchVectorField + directMappedFlowRateFvPatchVectorField ( const fvPatch&, const DimensionedField& ); //- Construct from patch, internal field and dictionary - flowRateInletVelocityCoupledFvPatchVectorField + directMappedFlowRateFvPatchVectorField ( const fvPatch&, const DimensionedField&, @@ -113,20 +108,20 @@ public: ); //- Construct by mapping given - // flowRateInletVelocityCoupledFvPatchVectorField + // directMappedFlowRateFvPatchVectorField // onto a new patch - flowRateInletVelocityCoupledFvPatchVectorField + directMappedFlowRateFvPatchVectorField ( - const flowRateInletVelocityCoupledFvPatchVectorField&, + const directMappedFlowRateFvPatchVectorField&, const fvPatch&, const DimensionedField&, const fvPatchFieldMapper& ); //- Construct as copy - flowRateInletVelocityCoupledFvPatchVectorField + directMappedFlowRateFvPatchVectorField ( - const flowRateInletVelocityCoupledFvPatchVectorField& + const directMappedFlowRateFvPatchVectorField& ); //- Construct and return a clone @@ -134,14 +129,14 @@ public: { return tmp ( - new flowRateInletVelocityCoupledFvPatchVectorField(*this) + new directMappedFlowRateFvPatchVectorField(*this) ); } //- Construct as copy setting internal field reference - flowRateInletVelocityCoupledFvPatchVectorField + directMappedFlowRateFvPatchVectorField ( - const flowRateInletVelocityCoupledFvPatchVectorField&, + const directMappedFlowRateFvPatchVectorField&, const DimensionedField& ); @@ -153,7 +148,7 @@ public: { return tmp ( - new flowRateInletVelocityCoupledFvPatchVectorField(*this, iF) + new directMappedFlowRateFvPatchVectorField(*this, iF) ); } diff --git a/src/parallel/decompose/scotchDecomp/scotchDecomp.C b/src/parallel/decompose/scotchDecomp/scotchDecomp.C index 17ff685d49..0851431b96 100644 --- a/src/parallel/decompose/scotchDecomp/scotchDecomp.C +++ b/src/parallel/decompose/scotchDecomp/scotchDecomp.C @@ -409,11 +409,32 @@ Foam::label Foam::scotchDecomp::decomposeOneProc << exit(FatalError); } + scalar velotabSum = sum(cWeights)/minWeights; + + scalar rangeScale(1.0); + + if (velotabSum > scalar(INT_MAX - 1)) + { + // 0.9 factor of safety to avoid floating point round-off in + // rangeScale tipping the subsequent sum over the integer limit. + rangeScale = 0.9*scalar(INT_MAX - 1)/velotabSum; + + WarningIn + ( + "scotchDecomp::decompose" + "(const pointField&, const scalarField&)" + ) << "Sum of weights has overflowed integer: " << velotabSum + << ", compressing weight scale by a factor of " << rangeScale + << endl; + } + // Convert to integers. velotab.setSize(cWeights.size()); + forAll(velotab, i) { - velotab[i] = int(cWeights[i]/minWeights); + velotab[i] = + int((cWeights[i]/minWeights - 1)*rangeScale) + 1; } } diff --git a/src/regionModels/pyrolysisModels/Make/files b/src/regionModels/pyrolysisModels/Make/files index cc875c46ca..6badede5bc 100644 --- a/src/regionModels/pyrolysisModels/Make/files +++ b/src/regionModels/pyrolysisModels/Make/files @@ -1,11 +1,3 @@ -/* derived patches */ - -derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2.C -derivedFvPatchFields/flowRateInletVelocityCoupled/flowRateInletVelocityCoupledFvPatchVectorField.C -derivedFvPatchFields/totalFlowRateAdvectiveDiffusiveFvPatchScalarField/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C -derivedFvPatchFields/turbulentTemperatureRadiativeCoupledMixed/turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField.C - - /* Pyrolysis models */ pyrolysisModel/pyrolysisModel.C pyrolysisModel/pyrolysisModelNew.C diff --git a/src/regionModels/pyrolysisModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2.C b/src/regionModels/pyrolysisModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2.C deleted file mode 100644 index b1c813fa09..0000000000 --- a/src/regionModels/pyrolysisModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2.C +++ /dev/null @@ -1,327 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2011 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 "turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2.H" -#include "addToRunTimeSelectionTable.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" -#include "directMappedPatchBase.H" -#include "mapDistribute.H" -#include "basicThermo.H" -#include "LESModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ -namespace LESModels -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2:: -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2 -( - const fvPatch& p, - const DimensionedField& iF -) -: - mixedFvPatchScalarField(p, iF), - nbrFieldName_("undefined-nbrFieldName"), - KName_("undefined-K") -{ - this->refValue() = 0.0; - this->refGrad() = 0.0; - this->valueFraction() = 1.0; -} - - -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2:: -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2 -( - const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - mixedFvPatchScalarField(ptf, p, iF, mapper), - nbrFieldName_(ptf.nbrFieldName_), - KName_(ptf.KName_) -{} - - -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2:: -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2 -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - mixedFvPatchScalarField(p, iF), - nbrFieldName_(dict.lookup("nbrFieldName")), - KName_(dict.lookup("K")) -{ - if (!isA(this->patch().patch())) - { - FatalErrorIn - ( - "turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2::" - "turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2\n" - "(\n" - " const fvPatch& p,\n" - " const DimensionedField& iF,\n" - " const dictionary& dict\n" - ")\n" - ) << "\n patch type '" << p.type() - << "' not type '" << directMappedPatchBase::typeName << "'" - << "\n for patch " << p.name() - << " of field " << dimensionedInternalField().name() - << " in file " << dimensionedInternalField().objectPath() - << exit(FatalError); - } - - fvPatchScalarField::operator=(scalarField("value", dict, p.size())); - - if (dict.found("refValue")) - { - // Full restart - refValue() = scalarField("refValue", dict, p.size()); - refGrad() = scalarField("refGradient", dict, p.size()); - valueFraction() = scalarField("valueFraction", dict, p.size()); - } - else - { - // Start from user entered data. Assume fixedValue. - refValue() = *this; - refGrad() = 0.0; - valueFraction() = 1.0; - } -} - - -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2:: -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2 -( - const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2& wtcsf, - const DimensionedField& iF -) -: - mixedFvPatchScalarField(wtcsf, iF), - nbrFieldName_(wtcsf.nbrFieldName_), - KName_(wtcsf.KName_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -tmp -turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2::K() const -{ - const fvMesh& mesh = patch().boundaryMesh().mesh(); - - if (KName_ == "none") - { - const LESModel& model = db().lookupObject("LESProperties"); - - const basicThermo& thermo = - db().lookupObject("thermophysicalProperties"); - - return - model.alphaEff()().boundaryField()[patch().index()] - *thermo.Cp()().boundaryField()[patch().index()]; - } - else if (mesh.objectRegistry::foundObject(KName_)) - { - return patch().lookupPatchField(KName_); - } - else if (mesh.objectRegistry::foundObject(KName_)) - { - const symmTensorField& KWall = - patch().lookupPatchField(KName_); - - vectorField n = patch().nf(); - - return n & KWall & n; - } - else - { - FatalErrorIn - ( - "turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2::K()" - " const" - ) << "Did not find field " << KName_ - << " on mesh " << mesh.name() << " patch " << patch().name() - << endl - << "Please set 'K' to 'none', a valid volScalarField" - << " or a valid volSymmTensorField." << exit(FatalError); - - return scalarField(0); - } -} - - -void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2::updateCoeffs() -{ - if (updated()) - { - return; - } - - // Get the coupling information from the directMappedPatchBase - const directMappedPatchBase& mpp = refCast - ( - patch().patch() - ); - const polyMesh& nbrMesh = mpp.sampleMesh(); - const fvPatch& nbrPatch = refCast - ( - nbrMesh - ).boundary()[mpp.samplePolyPatch().index()]; - - // Force recalculation of mapping and schedule - const mapDistribute& distMap = mpp.map(); - - tmp intFld = patchInternalField(); - - - // Calculate the temperature by harmonic averaging - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2& nbrField = - refCast - < - const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2 - > - ( - nbrPatch.lookupPatchField - ( - nbrFieldName_ - ) - ); - - // Swap to obtain full local values of neighbour internal field - scalarField nbrIntFld = nbrField.patchInternalField(); - mapDistribute::distribute - ( - Pstream::defaultCommsType, - distMap.schedule(), - distMap.constructSize(), - distMap.subMap(), // what to send - distMap.constructMap(), // what to receive - nbrIntFld - ); - - // Swap to obtain full local values of neighbour K*delta - scalarField nbrKDelta = nbrField.K()*nbrPatch.deltaCoeffs(); - mapDistribute::distribute - ( - Pstream::defaultCommsType, - distMap.schedule(), - distMap.constructSize(), - distMap.subMap(), // what to send - distMap.constructMap(), // what to receive - nbrKDelta - ); - - tmp myKDelta = K()*patch().deltaCoeffs(); - - - // Both sides agree on - // - temperature : (myKDelta*fld + nbrKDelta*nbrFld)/(myKDelta+nbrKDelta) - // - gradient : (temperature-fld)*delta - // We've got a degree of freedom in how to implement this in a mixed bc. - // (what gradient, what fixedValue and mixing coefficient) - // Two reasonable choices: - // 1. specify above temperature on one side (preferentially the high side) - // and above gradient on the other. So this will switch between pure - // fixedvalue and pure fixedgradient - // 2. specify gradient and temperature such that the equations are the - // same on both sides. This leads to the choice of - // - refGradient = zero gradient - // - refValue = neighbour value - // - mixFraction = nbrKDelta / (nbrKDelta + myKDelta()) - - - this->refValue() = nbrIntFld; - - this->refGrad() = 0.0; - - this->valueFraction() = nbrKDelta / (nbrKDelta + myKDelta()); - - mixedFvPatchScalarField::updateCoeffs(); - - - if (debug) - { - scalar Q = gSum(K()*patch().magSf()*snGrad()); - - Info<< patch().boundaryMesh().mesh().name() << ':' - << patch().name() << ':' - << this->dimensionedInternalField().name() << " <- " - << nbrMesh.name() << ':' - << nbrPatch.name() << ':' - << this->dimensionedInternalField().name() << " :" - << " heat[W]:" << Q - << " walltemperature " - << " min:" << gMin(*this) - << " max:" << gMax(*this) - << " avg:" << gAverage(*this) - << endl; - } -} - - -void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2::write -( - Ostream& os -) const -{ - mixedFvPatchScalarField::write(os); - os.writeKeyword("nbrFieldName")<< nbrFieldName_ - << token::END_STATEMENT << nl; - os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl; -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField -( - fvPatchScalarField, - turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2 -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace compressible -} // End namespace Foam -} // End namespace LESModels - -// ************************************************************************* // diff --git a/src/regionModels/pyrolysisModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2.H b/src/regionModels/pyrolysisModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2.H deleted file mode 100644 index 0545d5ab91..0000000000 --- a/src/regionModels/pyrolysisModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2.H +++ /dev/null @@ -1,190 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2011 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::compressible::LESModels - - turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2 - -Description - Mixed boundary condition for temperature, to be used for heat-transfer - on back-to-back baffles. - - If my temperature is T1, neighbour is T2: - - T1 > T2: my side becomes fixedValue T2 bc, other side becomes fixedGradient. - - - Example usage: - myInterfacePatchName - { - type compressible::turbulentTemperatureCoupledBaffleMixed; - nbrFieldName T; - K K; // or none - value uniform 300; - } - - Needs to be on underlying directMapped(Wall)FvPatch. - - Note: if K is "none" looks up RASModel and basicThermo, otherwise expects - the solver to calculate a 'K' field. - - Note: runs in parallel with arbitrary decomposition. Uses directMapped - functionality to calculate exchange. - - Note: lags interface data so both sides use same data. - - problem: schedule to calculate average would interfere - with standard processor swaps. - - so: updateCoeffs sets both to same Twall. Only need to do - this for last outer iteration but don't have access to this. - -SourceFiles - turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2.C - -\*---------------------------------------------------------------------------*/ - -#ifndef turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2_H -#define turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2_H - -#include "mixedFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ -namespace LESModels -{ - -/*---------------------------------------------------------------------------*\ - Class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2 Declaration -\*---------------------------------------------------------------------------*/ - -class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2 -: - public mixedFvPatchScalarField -{ - // Private data - - //- Name of field on the neighbour region - const word nbrFieldName_; - - //- Name of thermal conductivity field - const word KName_; - - -public: - - //- Runtime type information - TypeName("compressible::turbulentTemperatureCoupledBaffleMixed2"); - - - // Constructors - - //- Construct from patch and internal field - turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2 - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2 - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given - // turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2 onto a - // new patch - turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2 - ( - const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2 - ( - *this - ) - ); - } - - //- Construct as copy setting internal field reference - turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2 - ( - const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new turbulentTemperatureCoupledBaffleMixedFvPatchScalarField2 - ( - *this, - iF - ) - ); - } - - - // Member functions - - //- Get corresponding K field - tmp K() const; - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace LESModels -} // End namespace compressible -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/regionModels/pyrolysisModels/derivedFvPatchFields/turbulentTemperatureRadiativeCoupledMixed/turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField.C b/src/regionModels/pyrolysisModels/derivedFvPatchFields/turbulentTemperatureRadiativeCoupledMixed/turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField.C deleted file mode 100644 index 3f46e158b5..0000000000 --- a/src/regionModels/pyrolysisModels/derivedFvPatchFields/turbulentTemperatureRadiativeCoupledMixed/turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField.C +++ /dev/null @@ -1,539 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2011 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 "turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField.H" -#include "addToRunTimeSelectionTable.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" -#include "directMappedPatchBase.H" -#include "mapDistribute.H" -#include "regionProperties.H" -#include "basicThermo.H" -#include "LESModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ - -template<> -const char* -NamedEnum -< - turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField:: - operationMode, - 4 ->::names[] = -{ - "radiative_flux_from_neighbouring_region", - "radiative_flux_from_this_region", - "no_radiation_contribution", - "unknown" -}; - -const NamedEnum -< - turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField:: - operationMode, - 4 -> -turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField:: -operationModeNames; - - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField:: -turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF -) -: - mixedFvPatchScalarField(p, iF), - neighbourFieldName_("undefined-neighbourFieldName"), - neighbourFieldRadiativeName_("undefined-neigbourFieldRadiativeName"), - fieldRadiativeName_("undefined-fieldRadiativeName"), - KName_("undefined-K"), - oldMode_(unknown) -{ - this->refValue() = 0.0; - this->refGrad() = 0.0; - this->valueFraction() = 1.0; -} - - -turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField:: -turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField -( - const turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - mixedFvPatchScalarField(ptf, p, iF, mapper), - neighbourFieldName_(ptf.neighbourFieldName_), - neighbourFieldRadiativeName_(ptf.neighbourFieldRadiativeName_), - fieldRadiativeName_(ptf.fieldRadiativeName_), - KName_(ptf.KName_), - oldMode_(ptf.oldMode_) -{} - - -turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField:: -turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - mixedFvPatchScalarField(p, iF), - neighbourFieldName_(dict.lookup("neighbourFieldName")), - neighbourFieldRadiativeName_(dict.lookup("neighbourFieldRadiativeName")), - fieldRadiativeName_(dict.lookup("fieldRadiativeName")), - KName_(dict.lookup("K")), - oldMode_(unknown) -{ - if (!isA(this->patch().patch())) - { - FatalErrorIn - ( - "turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField::" - "turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField\n" - "(\n" - " const fvPatch& p,\n" - " const DimensionedField& iF,\n" - " const dictionary& dict\n" - ")\n" - ) << "\n patch type '" << p.type() - << "' not type '" << directMappedPatchBase::typeName << "'" - << "\n for patch " << p.name() - << " of field " << dimensionedInternalField().name() - << " in file " << dimensionedInternalField().objectPath() - << exit(FatalError); - } - - fvPatchScalarField::operator=(scalarField("value", dict, p.size())); - - if (dict.found("refValue")) - { - // Full restart - refValue() = scalarField("refValue", dict, p.size()); - refGrad() = scalarField("refGradient", dict, p.size()); - valueFraction() = scalarField("valueFraction", dict, p.size()); - } - else - { - // Start from user entered data. Assume fixedValue. - refValue() = *this; - refGrad() = 0.0; - valueFraction() = 1.0; - } -} - - -turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField:: -turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField -( - const turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField& - wtcsf, - const DimensionedField& iF -) -: - mixedFvPatchScalarField(wtcsf, iF), - neighbourFieldName_(wtcsf.neighbourFieldName_), - neighbourFieldRadiativeName_(wtcsf.neighbourFieldRadiativeName_), - fieldRadiativeName_(wtcsf.fieldRadiativeName_), - KName_(wtcsf.KName_), - oldMode_(wtcsf.oldMode_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -tmp -turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField::K() const -{ - const fvMesh& mesh = patch().boundaryMesh().mesh(); - - if (KName_ == "none") - { - const compressible::LESModel& model = - db().lookupObject("LESProperties"); - - const basicThermo& thermo = - db().lookupObject("thermophysicalProperties"); - - return - model.alphaEff()().boundaryField()[patch().index()] - *thermo.Cp()().boundaryField()[patch().index()]; - } - else if (mesh.objectRegistry::foundObject(KName_)) - { - return patch().lookupPatchField(KName_); - } - else if (mesh.objectRegistry::foundObject(KName_)) - { - const symmTensorField& KWall = - patch().lookupPatchField(KName_); - - vectorField n = patch().nf(); - - return n & KWall & n; - } - else - { - FatalErrorIn - ( - "turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::K()" - " const" - ) << "Did not find field " << KName_ - << " on mesh " << mesh.name() << " patch " << patch().name() - << endl - << "Please set 'K' to 'none', a valid volScalarField" - << " or a valid volSymmTensorField." << exit(FatalError); - - return scalarField(0); - } -} - - -void turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField:: -updateCoeffs() -{ - if (updated()) - { - return; - } - - // Get the coupling information from the directMappedPatchBase - const directMappedPatchBase& mpp = refCast - ( - patch().patch() - ); - const polyMesh& nbrMesh = mpp.sampleMesh(); - const fvPatch& nbrPatch = refCast - ( - nbrMesh - ).boundary()[mpp.samplePolyPatch().index()]; - - // Force recalculation of mapping and schedule - const mapDistribute& distMap = mpp.map(); - - scalarField intFld = patchInternalField(); - - const turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField& - nbrField = - refCast - < - const turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField - > - ( - nbrPatch.lookupPatchField - ( - neighbourFieldName_ - ) - ); - - // Swap to obtain full local values of neighbour internal field - scalarField nbrIntFld = nbrField.patchInternalField(); - mapDistribute::distribute - ( - Pstream::defaultCommsType, - distMap.schedule(), - distMap.constructSize(), - distMap.subMap(), // what to send - distMap.constructMap(), // what to receive - nbrIntFld - ); - - if (debug) - { - Info<< patch().boundaryMesh().mesh().name() << ':' - << patch().name() << ':' - << this->dimensionedInternalField().name() << " :" - << " internalT " - << " min:" << gMin(*this) - << " max:" << gMax(*this) - << " avg:" << gAverage(*this) - << endl; - - Info<< nbrMesh.name() << ':' - << nbrPatch.name() << ':' - << this->dimensionedInternalField().name() << " :" - << " internalT " - << " min:" << gMin(nbrIntFld) - << " max:" << gMax(nbrIntFld) - << " avg:" << gAverage(nbrIntFld) - << endl; - } - - - - // Check how to operate - operationMode mode = unknown; - { - if (neighbourFieldRadiativeName_ != "none") - { - if - ( - nbrMesh.foundObject - ( - neighbourFieldRadiativeName_ - ) - ) - { - mode = radFromNeighbour; - } - else - { - mode = noRad; - } - } - else - { - if - ( - patch().boundaryMesh().mesh().foundObject - ( - fieldRadiativeName_ - ) - ) - { - mode = radFromMe; - } - else - { - mode = noRad; - } - } - - // Do some warnings if change of mode. - if (mode != oldMode_) - { - WarningIn - ( - "turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField" - "::updateCoeffs()" - ) << "Switched from mode " << operationModeNames[oldMode_] - << " to mode " << operationModeNames[mode] - << endl; - } - oldMode_ = mode; - } - - - - // Swap to obtain full local values of neighbour K*delta - scalarField nbrKDelta = nbrField.K()*nbrPatch.deltaCoeffs(); - mapDistribute::distribute - ( - Pstream::defaultCommsType, - distMap.schedule(), - distMap.constructSize(), - distMap.subMap(), // what to send - distMap.constructMap(), // what to receive - nbrKDelta - ); - - scalarField myKDelta = K()*patch().deltaCoeffs(); - - scalarField nbrConvFlux = nbrKDelta*(*this - nbrIntFld); - - scalarField nbrTotalFlux = nbrConvFlux; - scalarList nbrRadField(nbrPatch.size(), 0.0); - scalarList myRadField(patch().size(), 0.0); - - // solid - if (mode == radFromNeighbour) - { - nbrRadField = - nbrPatch.lookupPatchField - ( - neighbourFieldRadiativeName_ - ); - - // Note: the Qr radiative flux is positive outgoing. - // For a hot solid radiating into a cold fluid Qr will be negative. - - - // Swap to obtain full local values of neighbour radiative heat flux - // field - mapDistribute::distribute - ( - Pstream::defaultCommsType, - distMap.schedule(), - distMap.constructSize(), - distMap.subMap(), // what to send - distMap.constructMap(), // what to receive - nbrRadField - ); - - nbrTotalFlux -= nbrRadField; - - const scalarField Twall = - (nbrRadField + myKDelta*intFld + nbrKDelta*nbrIntFld) - /(myKDelta + nbrKDelta); - - - if (debug) - { - scalar Qr = gSum(nbrRadField*patch().magSf()); - - Info<< patch().boundaryMesh().mesh().name() << ':' - << patch().name() << ':' - << this->dimensionedInternalField().name() << " :" << nl - << " radiative heat [W] : " << Qr << nl - << " predicted wallT [K] : " << gAverage(Twall) << nl - << endl; - } - - label nFixed = 0; - - forAll(*this, i) - { - - this->refValue()[i] = Twall[i]; - this->refGrad()[i] = 0.0; // not used - this->valueFraction()[i] = 1.0; - nFixed++; - } - - if (debug) - { - Pout<< "Using " << nFixed << " fixedValue out of " << this->size() - << endl; - } - } - else if (mode == radFromMe) //fluid - { - const scalarField& myRadField = - patch().lookupPatchField - ( - fieldRadiativeName_ - ); - - const scalarField Twall = - (myRadField + myKDelta*intFld + nbrKDelta*nbrIntFld) - /(myKDelta + nbrKDelta); - - if (debug) - { - scalar Qr = gSum(myRadField*patch().magSf()); - - Info<< patch().boundaryMesh().mesh().name() << ':' - << patch().name() << ':' - << this->dimensionedInternalField().name() << " :" << nl - << " radiative heat [W] : " << Qr << nl - << " predicted wallT [K] : " << gAverage(Twall) << nl - << endl; - } - - this->refValue() = Twall; - this->refGrad() = 0.0; // not used - this->valueFraction() = 1.0; - } - else if (mode == noRad) - { - this->refValue() = nbrIntFld; - this->refGrad() = 0.0; - this->valueFraction() = nbrKDelta / (nbrKDelta + myKDelta); - } - else - { - FatalErrorIn - ( - "turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField" - "::updateCoeffs()" - ) << "Illegal mode " << operationModeNames[mode] - << exit(FatalError); - } - - mixedFvPatchScalarField::updateCoeffs(); - - if (debug) - { - scalar Qc = gSum(nbrConvFlux*patch().magSf()); - scalar Qr = gSum(nbrRadField*patch().magSf()); - scalar Qt = gSum(nbrTotalFlux*patch().magSf()); - - Info<< patch().boundaryMesh().mesh().name() << ':' - << patch().name() << ':' - << this->dimensionedInternalField().name() << " <- " - << nbrMesh.name() << ':' - << nbrPatch.name() << ':' - << this->dimensionedInternalField().name() << " :" << nl - << " convective heat[W] : " << Qc << nl - << " radiative heat [W] : " << Qr << nl - << " total heat [W] : " << Qt << nl - << " walltemperature " - << " min:" << gMin(*this) - << " max:" << gMax(*this) - << " avg:" << gAverage(*this) - << endl; - } -} - - -void turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField::write -( - Ostream& os -) const -{ - mixedFvPatchScalarField::write(os); - os.writeKeyword("neighbourFieldName")<< neighbourFieldName_ - << token::END_STATEMENT << nl; - os.writeKeyword("neighbourFieldRadiativeName")<< - neighbourFieldRadiativeName_ << token::END_STATEMENT << nl; - os.writeKeyword("fieldRadiativeName")<< fieldRadiativeName_ - << token::END_STATEMENT << nl; - os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl; -// temperatureCoupledBase::write(os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField -( - fvPatchScalarField, - turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace compressible -} // End namespace Foam - - -// ************************************************************************* // diff --git a/src/regionModels/pyrolysisModels/derivedFvPatchFields/turbulentTemperatureRadiativeCoupledMixed/turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField.H b/src/regionModels/pyrolysisModels/derivedFvPatchFields/turbulentTemperatureRadiativeCoupledMixed/turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField.H deleted file mode 100644 index 2d101bbf00..0000000000 --- a/src/regionModels/pyrolysisModels/derivedFvPatchFields/turbulentTemperatureRadiativeCoupledMixed/turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField.H +++ /dev/null @@ -1,221 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2010-2011 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:: - compressible:: - turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField - -Description - Mixed boundary condition for temperature, to be used for heat-transfer - on back-to-back baffles. - - If my temperature is T1, neighbour is T2: - - T1 > T2: my side becomes fixedValue T2 bc, other side becomes fixedGradient. - - - Example usage: - myInterfacePatchName - { - type compressible::turbulentTemperatureRadiationCoupledMixedST; - neighbourFieldName T; - K lookup; - KName K; - - neighbourFieldRadiativeName Qr; // or none. Use on solid side - fieldRadiativeName Qr; // fluid. Use on fluid side - - value uniform 300; - } - - Needs to be on underlying directMapped(Wall)FvPatch. - - Note: K : heat conduction at patch. Gets supplied how to lookup/calculate K: - - 'lookup' : lookup volScalarField (or volSymmTensorField) with name - - 'basicThermo' : use basicThermo and compressible::RASmodel to calculate K - - 'solidThermo' : use basicSolidThermo K() - - 'directionalSolidThermo' directionalK() - - Note: runs in parallel with arbitrary decomposition. Uses directMapped - functionality to calculate exchange. - - Note: lags interface data so both sides use same data. - - problem: schedule to calculate average would interfere - with standard processor swaps. - - so: updateCoeffs sets both to same Twall. Only need to do - this for last outer iteration but don't have access to this. - -SourceFiles - turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField_H -#define turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField_H - -#include "mixedFvPatchFields.H" -//#include "temperatureCoupledBase.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ - -/*---------------------------------------------------------------------------*\ - Class turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField - Declaration -\*---------------------------------------------------------------------------*/ - -class turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField -: - public mixedFvPatchScalarField -// public temperatureCoupledBase -{ - // Private data - - //- Name of field on the neighbour region - const word neighbourFieldName_; - - //- Name of the radiative heat flux in the neighbout region - const word neighbourFieldRadiativeName_; - - //- Name of the radiative heat flux in the my region - const word fieldRadiativeName_; - - //- Name of thermal conductivity field - const word KName_; - - //- how to obtain radiative flux - enum operationMode - { - radFromNeighbour, - radFromMe, - noRad, - unknown - }; - static const NamedEnum operationModeNames; - - //- Previous iteration mode - operationMode oldMode_; - - -public: - - //- Runtime type information - TypeName("compressible::turbulentTemperatureRadiationCoupledMixedST"); - - - // Constructors - - //- Construct from patch and internal field - turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given - // turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a - // new patch - turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField - ( - const - turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new - turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField - ( - *this - ) - ); - } - - //- Construct as copy setting internal field reference - turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField - ( - const - turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new - turbulentTemperatureRadiationCoupledMixedSTFvPatchScalarField - ( - *this, - iF - ) - ); - } - - - // Member functions - - //- Get corresponding K field - tmp K() const; - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace compressible -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/regionModels/regionCoupling/Make/files b/src/regionModels/regionCoupling/Make/files index d9d961e3a5..846df33e9e 100644 --- a/src/regionModels/regionCoupling/Make/files +++ b/src/regionModels/regionCoupling/Make/files @@ -1,5 +1,4 @@ derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C derivedFvPatchFields/filmPyrolysisTemperatureCoupled/filmPyrolysisTemperatureCoupledFvPatchScalarField.C - LIB = $(FOAM_LIBBIN)/libregionCoupling diff --git a/src/regionModels/regionCoupling/Make/options b/src/regionModels/regionCoupling/Make/options index 40d7a67126..2eaffb3b4b 100644 --- a/src/regionModels/regionCoupling/Make/options +++ b/src/regionModels/regionCoupling/Make/options @@ -8,6 +8,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/solid/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ diff --git a/src/thermophysicalModels/solidChemistryModel/Make/options b/src/thermophysicalModels/solidChemistryModel/Make/options index d989adfd5b..2a5d76bca7 100644 --- a/src/thermophysicalModels/solidChemistryModel/Make/options +++ b/src/thermophysicalModels/solidChemistryModel/Make/options @@ -10,6 +10,6 @@ EXE_INC = \ LIB_LIBS = \ - -chemistryModel \ + -lchemistryModel \ -lfiniteVolume \ -lODE diff --git a/src/turbulenceModels/compressible/turbulenceModel/Make/files b/src/turbulenceModels/compressible/turbulenceModel/Make/files index 4a2f2106c3..dd14188e4d 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/Make/files +++ b/src/turbulenceModels/compressible/turbulenceModel/Make/files @@ -7,5 +7,7 @@ derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupl derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C derivedFvPatchFields/turbulentTemperatureCoupledBaffle/regionProperties.C derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarFields.C +derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C +derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C LIB = $(FOAM_LIBBIN)/libcompressibleTurbulenceModel diff --git a/src/turbulenceModels/compressible/turbulenceModel/Make/options b/src/turbulenceModels/compressible/turbulenceModel/Make/options index c9e7b7b0ee..c3d7e278f0 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/Make/options +++ b/src/turbulenceModels/compressible/turbulenceModel/Make/options @@ -13,5 +13,6 @@ LIB_LIBS = \ -lspecie \ -lfiniteVolume \ -lmeshTools \ - -lsolid + -lsolid \ + -lradiationModels diff --git a/src/regionModels/pyrolysisModels/derivedFvPatchFields/totalFlowRateAdvectiveDiffusiveFvPatchScalarField/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C similarity index 96% rename from src/regionModels/pyrolysisModels/derivedFvPatchFields/totalFlowRateAdvectiveDiffusiveFvPatchScalarField/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C rename to src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C index 23e11fe5c0..f4c24778d5 100644 --- a/src/regionModels/pyrolysisModels/derivedFvPatchFields/totalFlowRateAdvectiveDiffusiveFvPatchScalarField/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C @@ -29,7 +29,7 @@ License #include "volFields.H" #include "surfaceFields.H" #include "IOobjectList.H" -#include "LESModel.H" +#include "turbulenceModel.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -149,10 +149,10 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::updateCoeffs() const label patchI = patch().index(); - const compressible::LESModel& turbulence = - db().lookupObject + const compressible::turbulenceModel& turbulence = + db().lookupObject ( - "LESProperties" + "turbulenceModel" ); const fvsPatchField& phip = @@ -175,7 +175,7 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::updateCoeffs() if (debug) { - scalar phi = gSum(-phip*(*this));// + alphap*snGrad()); + scalar phi = gSum(-phip*(*this)); Info<< patch().boundaryMesh().mesh().name() << ':' << patch().name() << ':' diff --git a/src/regionModels/pyrolysisModels/derivedFvPatchFields/totalFlowRateAdvectiveDiffusiveFvPatchScalarField/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.H b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.H similarity index 98% rename from src/regionModels/pyrolysisModels/derivedFvPatchFields/totalFlowRateAdvectiveDiffusiveFvPatchScalarField/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.H rename to src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.H index e0120ea8e0..6b4080abb0 100644 --- a/src/regionModels/pyrolysisModels/derivedFvPatchFields/totalFlowRateAdvectiveDiffusiveFvPatchScalarField/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -179,8 +179,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // - diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C rename to src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H rename to src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H diff --git a/tutorials/basic/potentialFoam/cylinder/constant/polyMesh/blockMeshDict b/tutorials/basic/potentialFoam/cylinder/constant/polyMesh/blockMeshDict index 70cdc45711..6d12dbbff6 100644 --- a/tutorials/basic/potentialFoam/cylinder/constant/polyMesh/blockMeshDict +++ b/tutorials/basic/potentialFoam/cylinder/constant/polyMesh/blockMeshDict @@ -16,47 +16,49 @@ FoamFile convertToMeters 1; -vertices -( - (0.5 0 -0.5) - (1 0 -0.5) - (2 0 -0.5) - (2 0.707107 -0.5) - (0.707107 0.707107 -0.5) - (0.353553 0.353553 -0.5) - (2 2 -0.5) - (0.707107 2 -0.5) - (0 2 -0.5) - (0 1 -0.5) - (0 0.5 -0.5) - (-0.5 0 -0.5) - (-1 0 -0.5) - (-2 0 -0.5) - (-2 0.707107 -0.5) - (-0.707107 0.707107 -0.5) - (-0.353553 0.353553 -0.5) - (-2 2 -0.5) - (-0.707107 2 -0.5) - (0.5 0 0.5) - (1 0 0.5) - (2 0 0.5) - (2 0.707107 0.5) - (0.707107 0.707107 0.5) - (0.353553 0.353553 0.5) - (2 2 0.5) - (0.707107 2 0.5) - (0 2 0.5) - (0 1 0.5) - (0 0.5 0.5) - (-0.5 0 0.5) - (-1 0 0.5) - (-2 0 0.5) - (-2 0.707107 0.5) - (-0.707107 0.707107 0.5) - (-0.353553 0.353553 0.5) - (-2 2 0.5) - (-0.707107 2 0.5) -); +vertices #codeStream +{ + codeInclude + #{ + #include "pointField.H" + #}; + + code + #{ + pointField points(19); + points[0] = point(0.5, 0, -0.5); + points[1] = point(1, 0, -0.5); + points[2] = point(2, 0, -0.5); + points[3] = point(2, 0.707107, -0.5); + points[4] = point(0.707107, 0.707107, -0.5); + points[5] = point(0.353553, 0.353553, -0.5); + points[6] = point(2, 2, -0.5); + points[7] = point(0.707107, 2, -0.5); + points[8] = point(0, 2, -0.5); + points[9] = point(0, 1, -0.5); + points[10] = point(0, 0.5, -0.5); + points[11] = point(-0.5, 0, -0.5); + points[12] = point(-1, 0, -0.5); + points[13] = point(-2, 0, -0.5); + points[14] = point(-2, 0.707107, -0.5); + points[15] = point(-0.707107, 0.707107, -0.5); + points[16] = point(-0.353553, 0.353553, -0.5); + points[17] = point(-2, 2, -0.5); + points[18] = point(-0.707107, 2, -0.5); + + // Duplicate z points + label sz = points.size(); + points.setSize(2*sz); + for (label i = 0; i < sz; i++) + { + const point& pt = points[i]; + points[i+sz] = point(pt.x(), pt.y(), -pt.z()); + } + + os << points; + #}; +}; + blocks ( diff --git a/tutorials/basic/potentialFoam/cylinder/system/controlDict b/tutorials/basic/potentialFoam/cylinder/system/controlDict index 39199914b4..8f10f1fc76 100644 --- a/tutorials/basic/potentialFoam/cylinder/system/controlDict +++ b/tutorials/basic/potentialFoam/cylinder/system/controlDict @@ -49,8 +49,10 @@ functions { difference { + // Load the library containing the 'coded' functionObject functionObjectLibs ("libutilityFunctionObjects.so"); type coded; + // Name of on-the-fly generated functionObject redirectType error; code #{