GIT: Resolved conflict on merge from upstream

This commit is contained in:
Andrew Heather
2015-12-22 16:49:44 +00:00
381 changed files with 10834 additions and 2450 deletions

View File

@ -90,3 +90,27 @@ volScalarField dpdt
Info<< "Creating field kinetic energy K\n" << endl; Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U)); volScalarField K("K", 0.5*magSqr(U));
label pRefCell = 0;
scalar pRefValue = 0.0;
if (p_rgh.needReference())
{
setRefCell
(
p,
p_rgh,
pimple.dict(),
pRefCell,
pRefValue
);
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
}
dimensionedScalar initialMass("initialMass", fvc::domainIntegrate(rho));

View File

@ -1,4 +1,9 @@
{ {
bool closedVolume = p_rgh.needReference();
dimensionedScalar compressibility = fvc::domainIntegrate(psi);
bool compressible = (compressibility.value() > SMALL);
rho = thermo.rho(); rho = thermo.rho();
// Thermodynamic density needs to be updated by psi*d(p) after the // Thermodynamic density needs to be updated by psi*d(p) after the
@ -36,19 +41,27 @@
)/(mesh.magSf().boundaryField()*rAUf.boundaryField()) )/(mesh.magSf().boundaryField()*rAUf.boundaryField())
); );
fvScalarMatrix p_rghDDtEqn tmp<fvScalarMatrix> p_rghDDtEqn
(
new fvScalarMatrix(p_rgh, dimMass/dimTime)
);
if (compressible)
{
p_rghDDtEqn =
( (
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh)) fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
+ fvc::div(phiHbyA)
== ==
fvOptions(psi, p_rgh, rho.name()) fvOptions(psi, p_rgh, rho.name())
); );
}
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix p_rghEqn fvScalarMatrix p_rghEqn
( (
p_rghDDtEqn p_rghDDtEqn()
+ fvc::div(phiHbyA)
- fvm::laplacian(rAUf, p_rgh) - fvm::laplacian(rAUf, p_rgh)
); );
@ -81,6 +94,32 @@
dpdt = fvc::ddt(p); dpdt = fvc::ddt(p);
} }
if (compressible)
{
#include "rhoEqn.H" #include "rhoEqn.H"
#include "compressibleContinuityErrs.H" }
#include "compressibleContinuityErrs.H"
if (closedVolume)
{
if (!compressible)
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
}
else
{
p += (initialMass - fvc::domainIntegrate(thermo.rho()))
/compressibility;
rho = thermo.rho();
}
p_rgh = p - rho*gh;
}
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value()
<< endl;
} }

View File

@ -37,9 +37,9 @@ volVectorField U
#include "compressibleCreatePhi.H" #include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::RASModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
( (
compressible::New<compressible::RASModel> compressible::turbulenceModel::New
( (
rho, rho,
U, U,

View File

@ -34,6 +34,7 @@
)/(mesh.magSf().boundaryField()*rhorAUf.boundaryField()) )/(mesh.magSf().boundaryField()*rhorAUf.boundaryField())
); );
while (simple.correctNonOrthogonal()) while (simple.correctNonOrthogonal())
{ {
fvScalarMatrix p_rghEqn fvScalarMatrix p_rghEqn
@ -64,12 +65,27 @@
p = p_rgh + rho*gh; p = p_rgh + rho*gh;
dimensionedScalar compressibility = fvc::domainIntegrate(psi);
bool compressible = (compressibility.value() > SMALL);
// For closed-volume cases adjust the pressure level // For closed-volume cases adjust the pressure level
// to obey overall mass continuity // to obey overall mass continuity
if (closedVolume) if (closedVolume)
{
if(!compressible)
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
}
else
{ {
p += (initialMass - fvc::domainIntegrate(psi*p)) p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi); /fvc::domainIntegrate(psi);
}
p_rgh = p - rho*gh; p_rgh = p - rho*gh;
} }

View File

@ -36,12 +36,21 @@
)/(mesh.magSf().boundaryField()*rhorAUf.boundaryField()) )/(mesh.magSf().boundaryField()*rhorAUf.boundaryField())
); );
tmp<fvScalarMatrix> p_rghDDtEqn
(
new fvScalarMatrix(p_rgh, dimMass/dimTime)
);
{ {
fvScalarMatrix p_rghDDtEqn if (compressible)
{
p_rghDDtEqn =
( (
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh)) fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
+ fvc::div(phiHbyA) ==
fvOptions(psi, p_rgh, rho.name())
); );
}
// Thermodynamic density needs to be updated by psi*d(p) after the // Thermodynamic density needs to be updated by psi*d(p) after the
// pressure solution - done in 2 parts. Part 1: // pressure solution - done in 2 parts. Part 1:
@ -52,6 +61,7 @@
fvScalarMatrix p_rghEqn fvScalarMatrix p_rghEqn
( (
p_rghDDtEqn p_rghDDtEqn
+ fvc::div(phiHbyA)
- fvm::laplacian(rhorAUf, p_rgh) - fvm::laplacian(rhorAUf, p_rgh)
); );
@ -93,8 +103,11 @@
dpdt = fvc::ddt(p); dpdt = fvc::ddt(p);
} }
if (compressible)
{
// Solve continuity // Solve continuity
#include "rhoEqn.H" #include "rhoEqn.H"
}
// Update continuity errors // Update continuity errors
#include "compressibleContinuityErrors.H" #include "compressibleContinuityErrors.H"

View File

@ -0,0 +1,3 @@
simpleCoalParcelFoam.C
EXE = $(FOAM_APPBIN)/simpleCoalParcelFoam

View File

@ -0,0 +1,57 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam/simpleReactingParcelFoam
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lturbulenceModels \
-lcompressibleTurbulenceModels \
-llagrangian \
-llagrangianIntermediate \
-llagrangianTurbulence \
-lspecie \
-lfluidThermophysicalModels \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \
-lradiationModels \
-lODE \
-lregionModels \
-lsurfaceFilmModels \
-lcombustionModels \
-lfvOptions \
-lsampling \
-lcoalCombustion

View File

@ -0,0 +1,9 @@
Info<< "\nConstructing coal cloud" << endl;
coalCloud parcels
(
"reactingCloud1",
rho,
U,
g,
slgThermo
);

View File

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 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 <http://www.gnu.org/licenses/>.
Application
simpleReactingParcelFoam
Description
Steady state SIMPLE solver for laminar or turbulent flow with coal
Lagrangian parcels.
Note:
- including run-time selectable finite volume options,e.g. sources,
constraints
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "turbulentFluidThermoModel.H"
#include "coalCloud.H"
#include "rhoCombustionModel.H"
#include "radiationModel.H"
#include "IOporosityModelList.H"
#include "fvOptions.H"
#include "SLGThermo.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
simpleControl simple(mesh);
#include "createFields.H"
#include "createRadiationModel.H"
#include "createClouds.H"
#include "createMRF.H"
#include "createFvOptions.H"
#include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
parcels.evolve();
// --- Pressure-velocity SIMPLE corrector loop
{
#include "UEqn.H"
#include "YEqn.H"
#include "EEqn.H"
#include "pEqn.H"
}
turbulence->correct();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return(0);
}
// ************************************************************************* //

View File

@ -2,24 +2,17 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.openfoam.org | | \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
root "";
case "";
instance "";
local "";
class dictionary; class dictionary;
location "system";
object collapseDict; object collapseDict;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// If on, after collapsing check the quality of the mesh. If bad faces are // If on, after collapsing check the quality of the mesh. If bad faces are

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -1077,7 +1077,7 @@ void Foam::conformalVoronoiMesh::writeMesh
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
pointMesh::New(mesh), pointMesh::New(mesh),
scalar(labelMin) dimensionedScalar("min", dimless, scalar(labelMin))
); );
labelIOList boundaryPtsIO labelIOList boundaryPtsIO

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright 2015 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -58,6 +58,7 @@ Description
#include "globalIndex.H" #include "globalIndex.H"
#include "IOmanip.H" #include "IOmanip.H"
#include "decompositionModel.H" #include "decompositionModel.H"
#include "fvMeshTools.H"
using namespace Foam; using namespace Foam;
@ -813,6 +814,7 @@ int main(int argc, char *argv[])
readScalar(meshDict.lookup("mergeTolerance")) readScalar(meshDict.lookup("mergeTolerance"))
); );
const Switch keepPatches(meshDict.lookupOrDefault("keepPatches", false));
// Read decomposePar dictionary // Read decomposePar dictionary
@ -1517,6 +1519,12 @@ int main(int argc, char *argv[])
motionDict motionDict
); );
// Remove zero sized patches originating from faceZones
if (!keepPatches && !wantSnap && !wantLayers)
{
fvMeshTools::removeEmptyPatches(mesh, true);
}
writeMesh writeMesh
( (
"Refined mesh", "Refined mesh",
@ -1559,6 +1567,12 @@ int main(int argc, char *argv[])
snapParams snapParams
); );
// Remove zero sized patches originating from faceZones
if (!keepPatches && !wantLayers)
{
fvMeshTools::removeEmptyPatches(mesh, true);
}
writeMesh writeMesh
( (
"Snapped mesh", "Snapped mesh",
@ -1609,6 +1623,12 @@ int main(int argc, char *argv[])
distributor distributor
); );
// Remove zero sized patches originating from faceZones
if (!keepPatches)
{
fvMeshTools::removeEmptyPatches(mesh, true);
}
writeMesh writeMesh
( (
"Layer mesh", "Layer mesh",
@ -1622,6 +1642,7 @@ int main(int argc, char *argv[])
} }
{ {
// Check final mesh // Check final mesh
Info<< "Checking final mesh ..." << endl; Info<< "Checking final mesh ..." << endl;

View File

@ -188,6 +188,7 @@ castellatedMeshControls
//faceZone sphere; //faceZone sphere;
//cellZone sphere; //cellZone sphere;
//cellZoneInside inside; // outside/insidePoint //cellZoneInside inside; // outside/insidePoint
//insidePoint (1 1 1); // if (cellZoneInside == insidePoint)
//- Optional specification of what to do with faceZone faces: //- Optional specification of what to do with faceZone faces:
// internal : keep them as internal faces (default) // internal : keep them as internal faces (default)
@ -259,7 +260,12 @@ castellatedMeshControls
} }
// Limit refinement in geometric region // Optionally limit refinement in geometric region. This limits all
// refinement (from features, refinementSurfaces, refinementRegions)
// in a given geometric region. The syntax is exactly the same as for the
// refinementRegions; the cell level now specifies the upper limit
// for any cell. Note that it does not override the refinement constraints
// given by the nCellsBetweenLevels settting.
limitRegions limitRegions
{ {
} }
@ -290,14 +296,25 @@ castellatedMeshControls
locationInMesh (5 0.28 0.43); locationInMesh (5 0.28 0.43);
// Whether any faceZones (as specified in the refinementSurfaces) // Whether any faceZones (as specified in the refinementSurfaces)
// are only on the boundary of corresponding cellZones or also allow // are only on the boundary of corresponding cellZones.
// free-standing zone faces. Not used if there are no faceZones. // Not used if there are no faceZones. The behaviour has changed
// with respect to previous versions:
// true : all intersections with surface are put in faceZone
// (same behaviour as before)
// false : depending on the type of surface intersected:
// - if intersecting surface has faceZone only (so no cellZone)
// leave in faceZone (so behave as if set to true) (= changed
// behaviour)
// - if intersecting surface has faceZone and cellZone
// remove if inbetween same cellZone or if on boundary
// (same behaviour as before)
allowFreeStandingZoneFaces true; allowFreeStandingZoneFaces true;
// 2. Specify multiple locations with optional cellZones for the // 2. Specify multiple locations with optional cellZones for the
// regions. faceZones are automatically constructed from the // regions (use cellZone "none" to specify the unzoned cells)
// FaceZones are automatically constructed from the
// names of the cellZones: <cellZoneA> _to_ <cellZoneB> // names of the cellZones: <cellZoneA> _to_ <cellZoneB>
// where the cellZoneA is the lowest numbered cellZone (non-cellZone // where the cellZoneA is the lowest numbered cellZone (non-cellZone
// cells are in a special region called "none" which is always // cells are in a special region called "none" which is always

View File

@ -1827,6 +1827,8 @@ int main(int argc, char *argv[])
if (detectOnly) if (detectOnly)
{ {
Info<< "End\n" << endl;
return 0; return 0;
} }

View File

@ -183,7 +183,7 @@ void Foam::helpType::init()
( (
"browse", "browse",
"word", "word",
"display documentation for boundary condition in browser" "display documentation in browser"
); );
} }

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -2,8 +2,8 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -2,8 +2,8 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -290,6 +290,10 @@ void calc
mesh mesh
); );
// Note: fvOptions not directly used but constructs fvOptions so
// e.g. porosity modelling is effective for use in forces fo.
#include "createFvOptions.H"
if (phi.dimensions() == dimVolume/dimTime) if (phi.dimensions() == dimVolume/dimTime)
{ {
IOobject turbulencePropertiesHeader IOobject turbulencePropertiesHeader
@ -436,18 +440,23 @@ autoPtr<functionObjectList> readFunctionObjects
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Foam::timeSelector::addOptions(); timeSelector::addOptions();
#include "addRegionOption.H" #include "addRegionOption.H"
Foam::argList::addBoolOption argList::addBoolOption
( (
"noFlow", "noFlow",
"suppress creating flow models" "suppress creating flow models"
); );
argList::addBoolOption
(
"noRead",
"do not read any field data"
);
#include "addDictOption.H" #include "addDictOption.H"
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
Foam::instantList timeDirs = Foam::timeSelector::select0(runTime, args); instantList timeDirs = timeSelector::select0(runTime, args);
#include "createNamedMesh.H" #include "createNamedMesh.H"
// Externally stored dictionary for functionObjectList // Externally stored dictionary for functionObjectList

View File

@ -23,21 +23,6 @@ dict.add
); );
dict.add("mergeDistance", SMALL); dict.add("mergeDistance", SMALL);
labelHashSet includePatches;
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if
(
!pp.coupled()
&& !isA<cyclicAMIPolyPatch>(pp)
&& !isA<emptyPolyPatch>(pp)
)
{
includePatches.insert(patchI);
}
}
labelList triSurfaceToAgglom(5*nFineFaces); labelList triSurfaceToAgglom(5*nFineFaces);
const triSurface localSurface = triangulate const triSurface localSurface = triangulate
@ -69,6 +54,4 @@ distributedTriSurfaceMesh surfacesMesh
triSurfaceToAgglom.resize(surfacesMesh.size()); triSurfaceToAgglom.resize(surfacesMesh.size());
//surfacesMesh.searchableSurface::write();
surfacesMesh.setField(triSurfaceToAgglom); surfacesMesh.setField(triSurfaceToAgglom);

View File

@ -87,8 +87,8 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
DynamicList<label> dRayIs; DynamicList<label> dRayIs;
// Collect the rays which has not hit obstacle inbetween rayStartFace // Collect the rays which have no obstacle in between rayStartFace
// and rayEndFace. If the ray hit itself get stored in dRayIs // and rayEndFace. If the ray hit itself, it gets stored in dRayIs
forAll(hitInfo, rayI) forAll(hitInfo, rayI)
{ {
if (!hitInfo[rayI].hit()) if (!hitInfo[rayI].hit())

View File

@ -29,33 +29,42 @@ Description
(finalAgglom generated by faceAgglomerate utility). (finalAgglom generated by faceAgglomerate utility).
Each view factor between the agglomerated faces i and j (Fij) is calculated Each view factor between the agglomerated faces i and j (Fij) is calculated
using a double integral of the sub-areas composing the agglomaration. using a double integral of the sub-areas composing the agglomeration.
The patches involved in the view factor calculation are taken from the Qr The patches involved in the view factor calculation are taken from the
volScalarField (radiative flux) when is greyDiffusiveRadiationViewFactor boundary file and should be part on the group viewFactorWall. ie.:
otherwise they are not included.
floor
{
type wall;
inGroups 2(wall viewFactorWall);
nFaces 100;
startFace 3100;
}
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "argList.H" #include "argList.H"
#include "Time.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "singleCellFvMesh.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "fixedValueFvPatchFields.H"
#include "distributedTriSurfaceMesh.H" #include "distributedTriSurfaceMesh.H"
#include "cyclicAMIPolyPatch.H"
#include "mapDistribute.H"
#include "meshTools.H" #include "meshTools.H"
#include "uindirectPrimitivePatch.H" #include "uindirectPrimitivePatch.H"
#include "DynamicField.H" #include "DynamicField.H"
#include "unitConversion.H"
#include "scalarMatrices.H" #include "scalarMatrices.H"
#include "labelListIOList.H"
#include "scalarListIOList.H" #include "scalarListIOList.H"
#include "singleCellFvMesh.H"
#include "IOmapDistribute.H"
using namespace Foam; using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
triSurface triangulate triSurface triangulate
( (
@ -116,7 +125,7 @@ triSurface triangulate
newPatchI++; newPatchI++;
} }
triSurfaceToAgglom.resize(localTriFaceI); //striSurfaceToAgglom.resize(localTriFaceI-1);
triangles.shrink(); triangles.shrink();
@ -264,6 +273,8 @@ int main(int argc, char *argv[])
) )
); );
const word viewFactorWall("viewFactorWall");
const bool writeViewFactors = const bool writeViewFactors =
viewFactorDict.lookupOrDefault<bool>("writeViewFactorMatrix", false); viewFactorDict.lookupOrDefault<bool>("writeViewFactorMatrix", false);
@ -272,19 +283,6 @@ int main(int argc, char *argv[])
const label debug = viewFactorDict.lookupOrDefault<label>("debug", 0); const label debug = viewFactorDict.lookupOrDefault<label>("debug", 0);
volScalarField Qr
(
IOobject
(
"Qr",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
// Read agglomeration map // Read agglomeration map
labelListIOList finalAgglom labelListIOList finalAgglom
( (
@ -336,26 +334,13 @@ int main(int argc, char *argv[])
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();
const polyBoundaryMesh& coarsePatches = coarseMesh.boundaryMesh(); const polyBoundaryMesh& coarsePatches = coarseMesh.boundaryMesh();
labelList viewFactorsPatches(patches.size()); labelList viewFactorsPatches(patches.findIndices(viewFactorWall));
forAll (viewFactorsPatches, i)
const volScalarField::GeometricBoundaryField& Qrb = Qr.boundaryField();
label count = 0;
forAll(Qrb, patchI)
{ {
const polyPatch& pp = patches[patchI]; label patchI = viewFactorsPatches[i];
const fvPatchScalarField& QrpI = Qrb[patchI];
if ((isA<fixedValueFvPatchScalarField>(QrpI)) && (pp.size() > 0))
{
viewFactorsPatches[count] = QrpI.patch().index();
nCoarseFaces += coarsePatches[patchI].size(); nCoarseFaces += coarsePatches[patchI].size();
nFineFaces += patches[patchI].size(); nFineFaces += patches[patchI].size();
count ++;
} }
}
viewFactorsPatches.resize(count);
// total number of coarse faces // total number of coarse faces
label totalNCoarseFaces = nCoarseFaces; label totalNCoarseFaces = nCoarseFaces;
@ -381,21 +366,27 @@ int main(int argc, char *argv[])
DynamicList<label> localAgg(nCoarseFaces); DynamicList<label> localAgg(nCoarseFaces);
labelHashSet includePatches;
forAll(viewFactorsPatches, i) forAll(viewFactorsPatches, i)
{ {
const label patchID = viewFactorsPatches[i]; const label patchID = viewFactorsPatches[i];
const polyPatch& pp = patches[patchID]; const polyPatch& pp = patches[patchID];
const labelList& agglom = finalAgglom[patchID]; const labelList& agglom = finalAgglom[patchID];
includePatches.insert(patchID);
if (agglom.size() > 0)
{
label nAgglom = max(agglom)+1; label nAgglom = max(agglom)+1;
labelListList coarseToFine(invertOneToMany(nAgglom, agglom)); labelListList coarseToFine(invertOneToMany(nAgglom, agglom));
const labelList& coarsePatchFace = coarseMesh.patchFaceMap()[patchID]; const labelList& coarsePatchFace =
coarseMesh.patchFaceMap()[patchID];
const pointField& coarseCf = coarseMesh.Cf().boundaryField()[patchID]; const pointField& coarseCf =
const pointField& coarseSf = coarseMesh.Sf().boundaryField()[patchID]; coarseMesh.Cf().boundaryField()[patchID];
const pointField& coarseSf =
labelHashSet includePatches; coarseMesh.Sf().boundaryField()[patchID];
includePatches.insert(patchID);
forAll(coarseCf, faceI) forAll(coarseCf, faceI)
{ {
@ -449,9 +440,10 @@ int main(int argc, char *argv[])
localCoarseCf.append(cf); localCoarseCf.append(cf);
localCoarseSf.append(sf); localCoarseSf.append(sf);
localAgg.append(agglomI); localAgg.append(agglomI);
}
}
}
}
}
// Distribute local coarse Cf and Sf for shooting rays // Distribute local coarse Cf and Sf for shooting rays
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -478,7 +470,6 @@ int main(int argc, char *argv[])
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include "searchingEngine.H" #include "searchingEngine.H"
// Determine rays between coarse face centres // Determine rays between coarse face centres
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DynamicList<label> rayStartFace(nCoarseFaces + 0.01*nCoarseFaces); DynamicList<label> rayStartFace(nCoarseFaces + 0.01*nCoarseFaces);
@ -487,7 +478,7 @@ int main(int argc, char *argv[])
// Return rayStartFace in local index and rayEndFace in global index // Return rayStartFace in local index and rayEndFace in global index
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include "shootRays.H" #include "shootRays.H"
@ -508,7 +499,6 @@ int main(int argc, char *argv[])
nViewFactors += nVisibleFaceFaces[faceI]; nViewFactors += nVisibleFaceFaces[faceI];
} }
// - Construct compact numbering // - Construct compact numbering
// - return map from remote to compact indices // - return map from remote to compact indices
// (per processor (!= myProcNo) a map from remote index to compact index) // (per processor (!= myProcNo) a map from remote index to compact index)
@ -519,54 +509,6 @@ int main(int argc, char *argv[])
mapDistribute map(globalNumbering, rayEndFace, compactMap); mapDistribute map(globalNumbering, rayEndFace, compactMap);
labelListIOList IOsubMap
(
IOobject
(
"subMap",
mesh.facesInstance(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
map.subMap()
);
IOsubMap.write();
labelListIOList IOconstructMap
(
IOobject
(
"constructMap",
mesh.facesInstance(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
map.constructMap()
);
IOconstructMap.write();
IOList<label> consMapDim
(
IOobject
(
"constructMapDim",
mesh.facesInstance(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
List<label>(1, map.constructSize())
);
consMapDim.write();
// visibleFaceFaces has: // visibleFaceFaces has:
// (local face, local viewed face) = compact viewed face // (local face, local viewed face) = compact viewed face
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -600,10 +542,14 @@ int main(int argc, char *argv[])
forAll(viewFactorsPatches, i) forAll(viewFactorsPatches, i)
{ {
label patchID = viewFactorsPatches[i]; label patchID = viewFactorsPatches[i];
const labelList& agglom = finalAgglom[patchID]; const labelList& agglom = finalAgglom[patchID];
if (agglom.size() > 0)
{
label nAgglom = max(agglom)+1; label nAgglom = max(agglom)+1;
labelListList coarseToFine(invertOneToMany(nAgglom, agglom)); labelListList coarseToFine(invertOneToMany(nAgglom, agglom));
const labelList& coarsePatchFace = coarseMesh.patchFaceMap()[patchID]; const labelList& coarsePatchFace =
coarseMesh.patchFaceMap()[patchID];
forAll(coarseToFine, coarseI) forAll(coarseToFine, coarseI)
{ {
@ -629,6 +575,7 @@ int main(int argc, char *argv[])
); );
} }
} }
}
// Do all swapping // Do all swapping
map.distribute(compactCoarseSf); map.distribute(compactCoarseSf);
@ -837,6 +784,8 @@ int main(int argc, char *argv[])
{ {
label patchID = viewFactorsPatches[i]; label patchID = viewFactorsPatches[i];
const labelList& agglom = finalAgglom[patchID]; const labelList& agglom = finalAgglom[patchID];
if (agglom.size() > 0)
{
label nAgglom = max(agglom)+1; label nAgglom = max(agglom)+1;
labelListList coarseToFine(invertOneToMany(nAgglom, agglom)); labelListList coarseToFine(invertOneToMany(nAgglom, agglom));
const labelList& coarsePatchFace = const labelList& coarsePatchFace =
@ -855,6 +804,7 @@ int main(int argc, char *argv[])
compactI++; compactI++;
} }
} }
}
viewFactorField.write(); viewFactorField.write();
} }
@ -886,10 +836,6 @@ int main(int argc, char *argv[])
} }
if (Pstream::master())
{
scalarSquareMatrix Fmatrix(totalNCoarseFaces, totalNCoarseFaces, 0.0);
labelListList globalFaceFaces(visibleFaceFaces.size()); labelListList globalFaceFaces(visibleFaceFaces.size());
// Create globalFaceFaces needed to insert view factors // Create globalFaceFaces needed to insert view factors
@ -917,35 +863,37 @@ int main(int argc, char *argv[])
globalFaceFaces globalFaceFaces
); );
IOglobalFaceFaces.write(); IOglobalFaceFaces.write();
}
else
{
labelListList globalFaceFaces(visibleFaceFaces.size());
forAll(globalFaceFaces, faceI)
{
globalFaceFaces[faceI] = renumber
(
compactToGlobal,
visibleFaceFaces[faceI]
);
}
labelListIOList IOglobalFaceFaces
labelListIOList IOvisibleFaceFaces
( (
IOobject IOobject
( (
"globalFaceFaces", "visibleFaceFaces",
mesh.facesInstance(), mesh.facesInstance(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false false
), ),
globalFaceFaces visibleFaceFaces
);
IOvisibleFaceFaces.write();
IOmapDistribute IOmapDist
(
IOobject
(
"mapDist",
mesh.facesInstance(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
map.xfer()
); );
IOglobalFaceFaces.write(); IOmapDist.write();
}
Info<< "End\n" << endl; Info<< "End\n" << endl;
return 0; return 0;

View File

@ -74,14 +74,17 @@ void writeProcStats
forAll(surfBb, procI) forAll(surfBb, procI)
{ {
const List<treeBoundBox>& bbs = meshBb[procI]; Info<< "processor" << procI << nl;
Info<< "processor" << procI << nl const List<treeBoundBox>& bbs = meshBb[procI];
<< "\tMesh bounds : " << bbs[0] << nl; if (bbs.size())
{
Info<< "\tMesh bounds : " << bbs[0] << nl;
for (label i = 1; i < bbs.size(); i++) for (label i = 1; i < bbs.size(); i++)
{ {
Info<< "\t " << bbs[i]<< nl; Info<< "\t " << bbs[i]<< nl;
} }
}
Info<< "\tSurface bounding box : " << surfBb[procI] << nl Info<< "\tSurface bounding box : " << surfBb[procI] << nl
<< "\tTriangles : " << nFaces[procI] << nl << "\tTriangles : " << nFaces[procI] << nl
<< "\tVertices : " << nPoints[procI] << "\tVertices : " << nPoints[procI]
@ -112,12 +115,13 @@ int main(int argc, char *argv[])
runTime.functionObjects().off(); runTime.functionObjects().off();
const fileName surfFileName = args[1]; const fileName surfFileName = args[1];
const word distType = args[2]; const word distTypeName = args[2];
const label distType =
distributedTriSurfaceMesh::distributionTypeNames_[distTypeName];
Info<< "Reading surface from " << surfFileName << nl << nl Info<< "Reading surface from " << surfFileName << nl << nl
<< "Using distribution method " << "Using distribution method "
<< distributedTriSurfaceMesh::distributionTypeNames_[distType] << distTypeName << nl << endl;
<< " " << distType << nl << endl;
const bool keepNonMapped = args.options().found("keepNonMapped"); const bool keepNonMapped = args.options().found("keepNonMapped");
@ -141,13 +145,14 @@ int main(int argc, char *argv[])
} }
#include "createPolyMesh.H"
Random rndGen(653213); Random rndGen(653213);
// Determine mesh bounding boxes: // Determine mesh bounding boxes:
List<List<treeBoundBox> > meshBb(Pstream::nProcs()); List<List<treeBoundBox> > meshBb(Pstream::nProcs());
if (distType == distributedTriSurfaceMesh::FOLLOW)
{ {
#include "createPolyMesh.H"
meshBb[Pstream::myProcNo()] = List<treeBoundBox> meshBb[Pstream::myProcNo()] = List<treeBoundBox>
( (
1, 1,
@ -160,6 +165,23 @@ int main(int argc, char *argv[])
Pstream::scatterList(meshBb); Pstream::scatterList(meshBb);
} }
// Temporarily: override master-only checking
regIOobject::fileCheckTypes oldCheckType =
regIOobject::fileModificationChecking;
if (oldCheckType == regIOobject::timeStampMaster)
{
regIOobject::fileModificationChecking = regIOobject::timeStamp;
}
else if (oldCheckType == regIOobject::inotifyMaster)
{
regIOobject::fileModificationChecking = regIOobject::inotify;
}
IOobject io IOobject io
( (
surfFileName, // name surfFileName, // name
@ -175,83 +197,48 @@ int main(int argc, char *argv[])
fileName localPath(actualPath); fileName localPath(actualPath);
localPath.replace(runTime.rootPath() + '/', ""); localPath.replace(runTime.rootPath() + '/', "");
autoPtr<distributedTriSurfaceMesh> surfMeshPtr;
if (actualPath == io.objectPath()) if (actualPath == io.objectPath())
{ {
Info<< "Loading local (decomposed) surface " << localPath << nl <<endl; Info<< "Loading local (decomposed) surface " << localPath << nl <<endl;
surfMeshPtr.reset(new distributedTriSurfaceMesh(io));
} }
else else
{ {
Info<< "Loading undecomposed surface " << localPath << nl << endl; Info<< "Loading undecomposed surface " << localPath
<< " on master only" << endl;
triSurface s;
List<treeBoundBox> bbs;
if (Pstream::master())
{
// Actually load the surface
triSurfaceMesh surf(io);
s = surf;
bbs = List<treeBoundBox>(1, treeBoundBox(boundBox::greatBox));
}
else
{
bbs = List<treeBoundBox>(1, treeBoundBox(boundBox::invertedBox));
} }
// Create dummy dictionary for bounding boxes if does not exist.
if (!isFile(actualPath / "Dict"))
{
dictionary dict; dictionary dict;
dict.add("bounds", meshBb[Pstream::myProcNo()]); dict.add("distributionType", distTypeName);
dict.add("distributionType", distType);
dict.add("mergeDistance", SMALL); dict.add("mergeDistance", SMALL);
dict.add("bounds", bbs);
IOdictionary ioDict // Scatter patch information
( Pstream::scatter(s.patches());
IOobject
(
io.name() + "Dict",
io.instance(),
io.local(),
io.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
dict
);
Info<< "Writing dummy bounds dictionary to " << ioDict.name() // Construct distributedTrisurfaceMesh from components
<< nl << endl; IOobject notReadIO(io);
notReadIO.readOpt() = IOobject::NO_READ;
// Force writing in ascii surfMeshPtr.reset(new distributedTriSurfaceMesh(notReadIO, s, dict));
ioDict.regIOobject::writeObject
(
IOstream::ASCII,
IOstream::currentVersion,
ioDict.time().writeCompression()
);
} }
distributedTriSurfaceMesh& surfMesh = surfMeshPtr();
// Load surface
distributedTriSurfaceMesh surfMesh(io);
Info<< "Loaded surface" << nl << endl;
// Generate a test field
{
const triSurface& s = static_cast<const triSurface&>(surfMesh);
autoPtr<triSurfaceVectorField> fcPtr
(
new triSurfaceVectorField
(
IOobject
(
"faceCentres", // name
surfMesh.searchableSurface::time().timeName(), // instance
surfMesh.searchableSurface::local(), // local
surfMesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
surfMesh,
dimLength,
s.faceCentres()
)
);
// Steal pointer and store object on surfMesh
fcPtr.ptr()->store();
}
// Write per-processor stats // Write per-processor stats
@ -284,6 +271,10 @@ int main(int argc, char *argv[])
Info<< "Writing surface." << nl << endl; Info<< "Writing surface." << nl << endl;
surfMesh.objectRegistry::write(); surfMesh.objectRegistry::write();
regIOobject::fileModificationChecking = oldCheckType;
Info<< "End\n" << endl; Info<< "End\n" << endl;
return 0; return 0;

View File

@ -3,7 +3,7 @@
<div class="footer"> <div class="footer">
<p> <p>
Copyright&nbsp;&copy;&nbsp;2011-2013&nbsp; Copyright&nbsp;&copy;&nbsp;2011-2013&nbsp;
<a href="http://www.openfoam.org/about">OpenFOAM Foundation</a> <a href="http://www.openfoam.com/about">OpenFOAM</a>
| |
OPENFOAM&reg; is a registered OPENFOAM&reg; is a registered
<a href="http://www.openfoam.com/legal/trademark-policy.php">trademarks <a href="http://www.openfoam.com/legal/trademark-policy.php">trademarks

View File

@ -22,12 +22,12 @@
<div class="page-container"> <div class="page-container">
<div class="header"> <div class="header">
<div class="header-top"> <div class="header-top">
<a class="sitelogo" href="http://www.openfoam.org" title="Home"> <a class="sitelogo" href="http://www.openfoam.com" title="Home">
<img class=left src="../css/img/OpenFOAMlogo.png"> <img class=left src="../css/img/OpenFOAMlogo.png">
</a> </a>
<div class="sitename"> <div class="sitename">
<h1> <h1>
<a href="http://foam.sourceforge.net/doc/Doxygen/html/" <a href="http://www.openfoam.com/doc/Doxygen/html/"
title="Source Guide">OpenFOAM C++ Documentation title="Source Guide">OpenFOAM C++ Documentation
</a> </a>
</h1> </h1>

View File

@ -127,7 +127,7 @@ case SunOS:
default: default:
echo echo
echo "Your '$WM_ARCH' operating system is not supported by this release" echo "Your '$WM_ARCH' operating system is not supported by this release"
echo "of OpenFOAM. For further assistance, please contact www.OpenFOAM.org" echo "of OpenFOAM. For further assistance, please contact www.OpenFOAM.com"
echo echo
breaksw breaksw

View File

@ -156,7 +156,7 @@ SunOS)
/bin/cat <<USAGE 1>&2 /bin/cat <<USAGE 1>&2
Your "$WM_ARCH" operating system is not supported by this release Your "$WM_ARCH" operating system is not supported by this release
of OpenFOAM. For further assistance, please contact www.OpenFOAM.org of OpenFOAM. For further assistance, please contact www.OpenFOAM.com
USAGE USAGE
;; ;;

View File

@ -237,10 +237,8 @@ void Foam::sigFpe::unset(const bool verbose)
if (sigaction(SIGFPE, &oldAction_, NULL) < 0) if (sigaction(SIGFPE, &oldAction_, NULL) < 0)
{ {
FatalErrorIn FatalErrorInFunction
( << "Cannot reset SIGFPE trapping"
"Foam::sigFpe::unset(const bool)"
) << "Cannot reset SIGFPE trapping"
<< abort(FatalError); << abort(FatalError);
} }
@ -254,10 +252,8 @@ void Foam::sigFpe::unset(const bool verbose)
if (oldExcept == -1) if (oldExcept == -1)
{ {
FatalErrorIn FatalErrorInFunction
( << "Cannot reset SIGFPE trapping"
"sigFpe::unset(const bool)"
) << "Cannot reset SIGFPE trapping"
<< abort(FatalError); << abort(FatalError);
} }
sigFpeActive_ = false; sigFpeActive_ = false;

View File

@ -2,8 +2,8 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -2,8 +2,8 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -2,8 +2,8 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -2,8 +2,8 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -2,8 +2,8 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -2,8 +2,8 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -1115,7 +1115,7 @@ void Foam::argList::printUsage() const
Info<< nl Info<< nl
<<"Using: OpenFOAM-" << Foam::FOAMversion <<"Using: OpenFOAM-" << Foam::FOAMversion
<< " (see www.OpenFOAM.org)" << nl << " (see www.OpenFOAM.com)" << nl
<<"Build: " << Foam::FOAMbuild << nl <<"Build: " << Foam::FOAMbuild << nl
<< endl; << endl;
} }

View File

@ -28,13 +28,12 @@ License
\section about About OpenFOAM \section about About OpenFOAM
OpenFOAM is a free, open source CFD software package released free and OpenFOAM is a free, open source CFD software package released free and
open-source under the GNU General Public License by the, open-source under the GNU General Public License. It has a large
<a href="http://www.openfoam.org">OpenFOAM Foundation</a>. It has a large
user base across most areas of engineering and science, from both commercial user base across most areas of engineering and science, from both commercial
and academic organisations. OpenFOAM has an extensive range of features to and academic organisations. OpenFOAM has an extensive range of features to
solve anything from complex fluid flows involving chemical reactions, solve anything from complex fluid flows involving chemical reactions,
turbulence and heat transfer, to solid dynamics and electromagnetics. turbulence and heat transfer, to solid dynamics and electromagnetics.
<a href="http://www.openfoam.org/features">More ...</a> <a href="http://www.openfoam.com/features">More ...</a>
\section layout Code Layout \section layout Code Layout

View File

@ -25,6 +25,7 @@ License
#include "uniformInterpolationTable.H" #include "uniformInterpolationTable.H"
#include "Time.H" #include "Time.H"
#include "IOstream.H"
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
@ -228,7 +229,12 @@ void Foam::uniformInterpolationTable<Type>::write() const
dict.add("bound", bound_); dict.add("bound", bound_);
} }
dict.regIOobject::write(); dict.regIOobject::writeObject
(
IOstream::ASCII,
IOstream::currentVersion,
dict.time().writeCompression()
);
} }

View File

@ -2,8 +2,8 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -997,7 +997,7 @@ bool Foam::polyMesh::upToDatePoints(const regIOobject& io) const
void Foam::polyMesh::setUpToDatePoints(regIOobject& io) const void Foam::polyMesh::setUpToDatePoints(regIOobject& io) const
{ {
io.eventNo() = points_.eventNo(); io.eventNo() = points_.eventNo()+1;
} }

View File

@ -2,8 +2,8 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -2,8 +2,8 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -2,8 +2,8 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -62,7 +62,12 @@ tmp<volScalarField> kOmegaSSTDES<BasicTurbulenceModel>::dTilda
const volScalarField& k = this->k_; const volScalarField& k = this->k_;
const volScalarField& omega = this->omega_; const volScalarField& omega = this->omega_;
return min(CDES*this->delta(), sqrt(k)/(this->betaStar_*omega)); return
min
(
CDES*this->delta(),
sqrt(k + this->kMin_)/(this->betaStar_*omega)
);
} }

View File

@ -48,7 +48,13 @@ volScalarField dynamicKEqn<BasicTurbulenceModel>::Ck
const volSymmTensorField MM const volSymmTensorField MM
( (
simpleFilter_(-2.0*this->delta()*sqrt(KK)*filter_(D)) simpleFilter_
(
-2.0*this->delta()*sqrt
(
max(KK, dimensionedScalar("zero", KK.dimensions(), 0.0))
)*filter_(D)
)
); );
const volScalarField Ck const volScalarField Ck

View File

@ -155,7 +155,9 @@ void dynamicLagrangian<BasicTurbulenceModel>::correct()
} }
// Local references // Local references
const surfaceScalarField& phi = this->phi_; const alphaField& alpha = this->alpha_;
const rhoField& rho = this->rho_;
const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_;
const volVectorField& U = this->U_; const volVectorField& U = this->U_;
LESeddyViscosity<BasicTurbulenceModel>::correct(); LESeddyViscosity<BasicTurbulenceModel>::correct();
@ -185,11 +187,11 @@ void dynamicLagrangian<BasicTurbulenceModel>::correct()
fvScalarMatrix flmEqn fvScalarMatrix flmEqn
( (
fvm::ddt(flm_) fvm::ddt(alpha, rho, flm_)
+ fvm::div(phi, flm_) + fvm::div(alphaRhoPhi, flm_)
== ==
invT*LM rho*invT*LM
- fvm::Sp(invT, flm_) - fvm::Sp(rho*invT, flm_)
); );
flmEqn.relax(); flmEqn.relax();
@ -201,11 +203,11 @@ void dynamicLagrangian<BasicTurbulenceModel>::correct()
fvScalarMatrix fmmEqn fvScalarMatrix fmmEqn
( (
fvm::ddt(fmm_) fvm::ddt(alpha, rho, fmm_)
+ fvm::div(phi, fmm_) + fvm::div(alphaRhoPhi, fmm_)
== ==
invT*MM rho*invT*MM
- fvm::Sp(invT, fmm_) - fvm::Sp(rho*invT, fmm_)
); );
fmmEqn.relax(); fmmEqn.relax();

View File

@ -284,6 +284,17 @@ void realizableKE<BasicTurbulenceModel>::correct()
// Update epsilon and G at the wall // Update epsilon and G at the wall
epsilon_.boundaryField().updateCoeffs(); epsilon_.boundaryField().updateCoeffs();
// SAF: limiting thermo->nu(). If psiThermo is used rho might be < 0
// temporarily when p < 0 then nu < 0 which needs limiting
volScalarField nuLimited
(
max
(
this->nu(),
dimensionedScalar("zero", this->nu()().dimensions(), 0.0)
)
);
// Dissipation equation // Dissipation equation
tmp<fvScalarMatrix> epsEqn tmp<fvScalarMatrix> epsEqn
( (
@ -294,7 +305,7 @@ void realizableKE<BasicTurbulenceModel>::correct()
C1*alpha*rho*magS*epsilon_ C1*alpha*rho*magS*epsilon_
- fvm::Sp - fvm::Sp
( (
C2_*alpha*rho*epsilon_/(k_ + sqrt(this->nu()*epsilon_)), C2_*alpha*rho*epsilon_/(k_ + sqrt(nuLimited*epsilon_)),
epsilon_ epsilon_
) )
+ epsilonSource() + epsilonSource()

View File

@ -38,16 +38,47 @@ namespace RASModels
template<class BasicTurbulenceModel> template<class BasicTurbulenceModel>
tmp<volScalarField> v2f<BasicTurbulenceModel>::Ts() const tmp<volScalarField> v2f<BasicTurbulenceModel>::Ts() const
{ {
return max(k_/epsilon_, 6.0*sqrt(this->nu()/epsilon_)); // SAF: limiting thermo->nu(). If psiThermo is used rho might be < 0
// temporarily when p < 0 then nu < 0 which needs limiting
return
max
(
k_/epsilon_,
6.0*sqrt
(
max
(
this->nu(),
dimensionedScalar("zero", this->nu()().dimensions(), 0.0)
)
/ epsilon_
)
);
} }
template<class BasicTurbulenceModel> template<class BasicTurbulenceModel>
tmp<volScalarField> v2f<BasicTurbulenceModel>::Ls() const tmp<volScalarField> v2f<BasicTurbulenceModel>::Ls() const
{ {
// SAF: limiting thermo->nu(). If psiThermo is used rho might be < 0
// temporarily when p < 0 then nu < 0 which needs limiting
return return
CL_*max(pow(k_, 1.5) CL_
/epsilon_, Ceta_*pow025(pow3(this->nu())/epsilon_)); * max
(
pow(k_, 1.5)/epsilon_,
Ceta_*pow025
(
pow3
(
max
(
this->nu(),
dimensionedScalar("zero", this->nu()().dimensions(), 0.0)
)
)/epsilon_
)
);
} }

View File

@ -109,7 +109,7 @@ void Foam::fixedShearStressFvPatchVectorField::updateCoeffs()
) )
); );
scalarField nuEff(turbModel.nuEff()()[patch().index()]); tmp<scalarField> nuEff(turbModel.nuEff(patch().index()));
const vectorField Uc(patchInternalField()); const vectorField Uc(patchInternalField());
@ -117,7 +117,7 @@ void Foam::fixedShearStressFvPatchVectorField::updateCoeffs()
const scalarField& ry = patch().deltaCoeffs(); const scalarField& ry = patch().deltaCoeffs();
operator==(tauHat*(tauHat & (tau0_*(1.0/(ry*nuEff)) + Uc))); operator==(tauHat*(tauHat & (tau0_*(1.0/(ry*nuEff())) + Uc)));
fixedValueFvPatchVectorField::updateCoeffs(); fixedValueFvPatchVectorField::updateCoeffs();
} }

View File

@ -860,16 +860,62 @@ Foam::labelList Foam::dynamicRefineFvMesh::selectUnrefinePoints
// All points that can be unrefined // All points that can be unrefined
const labelList splitPoints(meshCutter_.getSplitPoints()); const labelList splitPoints(meshCutter_.getSplitPoints());
const labelListList& pointCells = this->pointCells();
// If we have any protected cells make sure they also are not being
// unrefined
PackedBoolList protectedPoint(nPoints());
if (protectedCell_.size())
{
// Get all points on a protected cell
forAll(pointCells, pointI)
{
const labelList& pCells = pointCells[pointI];
forAll(pCells, pCellI)
{
label cellI = pCells[pCellI];
if (protectedCell_[cellI])
{
protectedPoint[pointI] = true;
break;
}
}
}
syncTools::syncPointList
(
*this,
protectedPoint,
orEqOp<unsigned int>(),
0U
);
if (debug)
{
Info<< "From "
<< returnReduce(protectedCell_.count(), sumOp<label>())
<< " protected cells found "
<< returnReduce(protectedPoint.count(), sumOp<label>())
<< " protected points." << endl;
}
}
DynamicList<label> newSplitPoints(splitPoints.size()); DynamicList<label> newSplitPoints(splitPoints.size());
forAll(splitPoints, i) forAll(splitPoints, i)
{ {
label pointI = splitPoints[i]; label pointI = splitPoints[i];
if (pFld[pointI] < unrefineLevel) if (!protectedPoint[pointI] && pFld[pointI] < unrefineLevel)
{ {
// Check that all cells are not marked // Check that all cells are not marked
const labelList& pCells = pointCells()[pointI]; const labelList& pCells = pointCells[pointI];
bool hasMarked = false; bool hasMarked = false;

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -355,6 +355,69 @@ void Foam::fvMeshTools::reorderPatches
} }
Foam::labelList Foam::fvMeshTools::removeEmptyPatches
(
fvMesh& mesh,
const bool validBoundary
)
{
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
labelList newToOld(pbm.size());
labelList oldToNew(pbm.size(), -1);
label newI = 0;
// Assumes all non-coupled boundaries are on all processors!
forAll(pbm, patchI)
{
const polyPatch& pp = pbm[patchI];
if (!isA<processorPolyPatch>(pp))
{
label nFaces = pp.size();
if (validBoundary)
{
reduce(nFaces, sumOp<label>());
}
if (nFaces > 0)
{
newToOld[newI] = patchI;
oldToNew[patchI] = newI++;
}
}
}
// Same for processor patches (but need no reduction)
forAll(pbm, patchI)
{
const polyPatch& pp = pbm[patchI];
if (isA<processorPolyPatch>(pp) && pp.size())
{
newToOld[newI] = patchI;
oldToNew[patchI] = newI++;
}
}
newToOld.setSize(newI);
// Move all deleteable patches to the end
forAll(oldToNew, patchI)
{
if (oldToNew[patchI] == -1)
{
oldToNew[patchI] = newI++;
}
}
reorderPatches(mesh, oldToNew, newToOld.size(), validBoundary);
return newToOld;
}
Foam::autoPtr<Foam::fvMesh> Foam::fvMeshTools::newMesh Foam::autoPtr<Foam::fvMesh> Foam::fvMeshTools::newMesh
( (
const IOobject& io, const IOobject& io,

View File

@ -113,7 +113,7 @@ public:
static void zeroPatchFields(fvMesh& mesh, const label patchI); static void zeroPatchFields(fvMesh& mesh, const label patchI);
//- Reorder and remove trailing patches. If validBoundary call is parallel //- Reorder and remove trailing patches. If validBoundary call is parallel
// synced and all add the same patch with same settings // synced
static void reorderPatches static void reorderPatches
( (
fvMesh&, fvMesh&,
@ -122,6 +122,11 @@ public:
const bool validBoundary const bool validBoundary
); );
//- Remove zero sized patches. All but processor patches are
// assumed to be present on all processors (so size will be reduced
// if validBoundary). Return map from new
// to old patches
static labelList removeEmptyPatches(fvMesh&, const bool validBoundary);
//- Read mesh or create dummy mesh (0 cells, >0 patches). Works in two //- Read mesh or create dummy mesh (0 cells, >0 patches). Works in two
// modes according to masterOnlyReading: // modes according to masterOnlyReading:
@ -133,7 +138,6 @@ public:
const IOobject& io, const IOobject& io,
const bool masterOnlyReading const bool masterOnlyReading
); );
}; };

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -2,8 +2,8 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -2,8 +2,8 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -2,8 +2,8 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -47,8 +47,6 @@ average
const GeometricField<Type, fvsPatchField, surfaceMesh>& ssf const GeometricField<Type, fvsPatchField, surfaceMesh>& ssf
) )
{ {
Info<< "average" << endl;
const fvMesh& mesh = ssf.mesh(); const fvMesh& mesh = ssf.mesh();
tmp<GeometricField<Type, fvPatchField, volMesh> > taverage tmp<GeometricField<Type, fvPatchField, volMesh> > taverage

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.

Some files were not shown because too many files have changed in this diff Show More