Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

Conflicts:
	src/meshTools/coordinateSystems/coordinateRotation/localAxesRotation.C
This commit is contained in:
sergio
2013-01-21 17:13:37 +00:00
67 changed files with 847 additions and 411 deletions

View File

@ -36,7 +36,6 @@ Description
#include "basicReactingMultiphaseCloud.H" #include "basicReactingMultiphaseCloud.H"
#include "rhoCombustionModel.H" #include "rhoCombustionModel.H"
#include "radiationModel.H" #include "radiationModel.H"
#include "IOporosityModelList.H"
#include "fvIOoptionList.H" #include "fvIOoptionList.H"
#include "SLGThermo.H" #include "SLGThermo.H"
#include "pimpleControl.H" #include "pimpleControl.H"

View File

@ -14,6 +14,11 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// If on, after collapsing check the quality of the mesh. If bad faces are
// generated then redo the collapsing with stricter filtering.
controlMeshQuality on;
collapseEdgesCoeffs collapseEdgesCoeffs
{ {
// Edges shorter than this absolute value will be merged // Edges shorter than this absolute value will be merged
@ -22,21 +27,13 @@ collapseEdgesCoeffs
// The maximum angle between two edges that share a point attached to // The maximum angle between two edges that share a point attached to
// no other edges // no other edges
maximumMergeAngle 30; maximumMergeAngle 30;
// The amount that minimumEdgeLength will be reduced by for each
// edge if that edge's collapse generates a poor quality face
reductionFactor 0.5;
} }
collapseFacesCoeffs collapseFacesCoeffs
{ {
// The initial face length factor // The initial face length factor
initialFaceLengthFactor 0.5; initialFaceLengthFactor 0.5;
// The amount that initialFaceLengthFactor will be reduced by for each
// face if its collapse generates a poor quality face
reductionFactor $initialFaceLengthFactor;
// If the face can't be collapsed to an edge, and it has a span less than // If the face can't be collapsed to an edge, and it has a span less than
// the target face length multiplied by this coefficient, collapse it // the target face length multiplied by this coefficient, collapse it
@ -63,12 +60,20 @@ collapseFacesCoeffs
} }
meshQualityCoeffs controlMeshQualityCoeffs
{ {
// Name of the dictionary that has the mesh quality coefficients used // Name of the dictionary that has the mesh quality coefficients used
// by motionSmoother::checkMesh // by motionSmoother::checkMesh
#include "meshQualityDict"; #include "meshQualityDict";
// The amount that minimumEdgeLength will be reduced by for each
// edge if that edge's collapse generates a poor quality face
edgeReductionFactor 0.5;
// The amount that initialFaceLengthFactor will be reduced by for each
// face if its collapse generates a poor quality face
faceReductionFactor $initialFaceLengthFactor;
// Maximum number of smoothing iterations for the reductionFactors // Maximum number of smoothing iterations for the reductionFactors
maximumSmoothingIterations 2; maximumSmoothingIterations 2;

View File

@ -427,9 +427,13 @@ Foam::polyMeshFilter::polyMeshFilter(const fvMesh& mesh)
IOobject::NO_WRITE IOobject::NO_WRITE
) )
), ),
controlMeshQuality_
(
dict_.lookupOrDefault<Switch>("controlMeshQuality", false)
),
collapseEdgesCoeffDict_(dict_.subDict("collapseEdgesCoeffs")), collapseEdgesCoeffDict_(dict_.subDict("collapseEdgesCoeffs")),
collapseFacesCoeffDict_(dict_.subDict("collapseFacesCoeffs")), collapseFacesCoeffDict_(dict_.subOrEmptyDict("collapseFacesCoeffs")),
meshQualityCoeffDict_(dict_.subDict("meshQualityCoeffs")), meshQualityCoeffDict_(dict_.subOrEmptyDict("controlMeshQualityCoeffs")),
minLen_(readScalar(collapseEdgesCoeffDict_.lookup("minimumEdgeLength"))), minLen_(readScalar(collapseEdgesCoeffDict_.lookup("minimumEdgeLength"))),
maxCos_ maxCos_
( (
@ -443,27 +447,39 @@ Foam::polyMeshFilter::polyMeshFilter(const fvMesh& mesh)
), ),
edgeReductionFactor_ edgeReductionFactor_
( (
readScalar(collapseEdgesCoeffDict_.lookup("reductionFactor")) meshQualityCoeffDict_.lookupOrDefault<scalar>("edgeReductionFactor", -1)
), ),
maxIterations_ maxIterations_
( (
readLabel(meshQualityCoeffDict_.lookup("maximumIterations")) meshQualityCoeffDict_.lookupOrAddDefault<label>("maximumIterations", 1)
), ),
maxSmoothIters_ maxSmoothIters_
( (
readLabel(meshQualityCoeffDict_.lookup("maximumSmoothingIterations")) meshQualityCoeffDict_.lookupOrAddDefault<label>
(
"maximumSmoothingIterations",
0
)
), ),
initialFaceLengthFactor_ initialFaceLengthFactor_
( (
readScalar(collapseFacesCoeffDict_.lookup("initialFaceLengthFactor")) collapseFacesCoeffDict_.lookupOrAddDefault<scalar>
(
"initialFaceLengthFactor",
-1
)
), ),
faceReductionFactor_ faceReductionFactor_
( (
readScalar(collapseFacesCoeffDict_.lookup("reductionFactor")) meshQualityCoeffDict_.lookupOrAddDefault<scalar>
(
"faceReductionFactor",
-1
)
), ),
maxPointErrorCount_ maxPointErrorCount_
( (
readLabel(meshQualityCoeffDict_.lookup("maxPointErrorCount")) meshQualityCoeffDict_.lookupOrAddDefault<label>("maxPointErrorCount", 0)
), ),
minEdgeLen_(), minEdgeLen_(),
faceFilterFactor_() faceFilterFactor_()
@ -547,23 +563,10 @@ Foam::label Foam::polyMeshFilter::filter(const label nOriginalBadFaces)
Map<point> collapsePointToLocation(newMesh.nPoints()); Map<point> collapsePointToLocation(newMesh.nPoints());
// Mark points on boundary // Mark points on boundary
const labelList boundaryPoint = findBoundaryPoints const labelList boundaryPoint = findBoundaryPoints(newMesh);
(
newMesh//,
// boundaryIOPts
);
edgeCollapser collapser(newMesh, collapseFacesCoeffDict_); edgeCollapser collapser(newMesh, collapseFacesCoeffDict_);
// Per face collapse status:
// -1 : not collapsed
// >= 0 : index of point in face to collapse to
List<Map<point> > faceCollapseToPoints
(
newMesh.nFaces(),
Map<point>()
);
{ {
// Collapse faces // Collapse faces
labelPair nCollapsedPtEdge = collapser.markSmallSliverFaces labelPair nCollapsedPtEdge = collapser.markSmallSliverFaces
@ -832,41 +835,48 @@ Foam::label Foam::polyMeshFilter::filter(const label nOriginalBadFaces)
// Do not allow collapses in regions of error. // Do not allow collapses in regions of error.
// Updates minEdgeLen, nRelaxedEdges // Updates minEdgeLen, nRelaxedEdges
PackedBoolList isErrorPoint(newMesh.nPoints()); if (controlMeshQuality_)
nBadFaces = edgeCollapser::checkMeshQuality {
( PackedBoolList isErrorPoint(newMesh.nPoints());
newMesh, nBadFaces = edgeCollapser::checkMeshQuality
meshQualityCoeffDict_, (
isErrorPoint newMesh,
); meshQualityCoeffDict_,
isErrorPoint
);
Info<< nl << " Number of bad faces : " << nBadFaces << nl Info<< nl << " Number of bad faces : " << nBadFaces << nl
<< " Number of marked points : " << " Number of marked points : "
<< returnReduce(isErrorPoint.count(), sumOp<unsigned int>()) << returnReduce(isErrorPoint.count(), sumOp<unsigned int>())
<< endl; << endl;
updatePointErrorCount updatePointErrorCount
( (
isErrorPoint, isErrorPoint,
origToCurrentPointMap, origToCurrentPointMap,
pointErrorCount pointErrorCount
); );
checkMeshEdgesAndRelaxEdges checkMeshEdgesAndRelaxEdges
( (
newMesh, newMesh,
origToCurrentPointMap, origToCurrentPointMap,
isErrorPoint, isErrorPoint,
pointErrorCount pointErrorCount
); );
checkMeshFacesAndRelaxEdges checkMeshFacesAndRelaxEdges
( (
newMesh, newMesh,
origToCurrentPointMap, origToCurrentPointMap,
isErrorPoint, isErrorPoint,
pointErrorCount pointErrorCount
); );
}
else
{
return -1;
}
} }
return nBadFaces; return nBadFaces;
@ -931,11 +941,7 @@ Foam::label Foam::polyMeshFilter::filterEdges
Map<point> collapsePointToLocation(newMesh.nPoints()); Map<point> collapsePointToLocation(newMesh.nPoints());
// Mark points on boundary // Mark points on boundary
const labelList boundaryPoint = findBoundaryPoints const labelList boundaryPoint = findBoundaryPoints(newMesh);
(
newMesh//,
// boundaryIOPts
);
edgeCollapser collapser(newMesh, collapseFacesCoeffDict_); edgeCollapser collapser(newMesh, collapseFacesCoeffDict_);
@ -1059,33 +1065,40 @@ Foam::label Foam::polyMeshFilter::filterEdges
// Do not allow collapses in regions of error. // Do not allow collapses in regions of error.
// Updates minEdgeLen, nRelaxedEdges // Updates minEdgeLen, nRelaxedEdges
PackedBoolList isErrorPoint(newMesh.nPoints()); if (controlMeshQuality_)
nBadFaces = edgeCollapser::checkMeshQuality {
( PackedBoolList isErrorPoint(newMesh.nPoints());
newMesh, nBadFaces = edgeCollapser::checkMeshQuality
meshQualityCoeffDict_, (
isErrorPoint newMesh,
); meshQualityCoeffDict_,
isErrorPoint
);
Info<< nl << " Number of bad faces : " << nBadFaces << nl Info<< nl << " Number of bad faces : " << nBadFaces << nl
<< " Number of marked points : " << " Number of marked points : "
<< returnReduce(isErrorPoint.count(), sumOp<unsigned int>()) << returnReduce(isErrorPoint.count(), sumOp<unsigned int>())
<< endl; << endl;
updatePointErrorCount updatePointErrorCount
( (
isErrorPoint, isErrorPoint,
origToCurrentPointMap, origToCurrentPointMap,
pointErrorCount pointErrorCount
); );
checkMeshEdgesAndRelaxEdges checkMeshEdgesAndRelaxEdges
( (
newMesh, newMesh,
origToCurrentPointMap, origToCurrentPointMap,
isErrorPoint, isErrorPoint,
pointErrorCount pointErrorCount
); );
}
else
{
return -1;
}
} }
return nBadFaces; return nBadFaces;
@ -1174,18 +1187,21 @@ Foam::label Foam::polyMeshFilter::filterIndirectPatchFaces()
// Do not allow collapses in regions of error. // Do not allow collapses in regions of error.
// Updates minEdgeLen, nRelaxedEdges // Updates minEdgeLen, nRelaxedEdges
PackedBoolList isErrorPoint(newMesh.nPoints()); if (controlMeshQuality_)
nBadFaces = edgeCollapser::checkMeshQuality {
( PackedBoolList isErrorPoint(newMesh.nPoints());
newMesh, nBadFaces = edgeCollapser::checkMeshQuality
meshQualityCoeffDict_, (
isErrorPoint newMesh,
); meshQualityCoeffDict_,
isErrorPoint
);
Info<< nl << " Number of bad faces : " << nBadFaces << nl Info<< nl << " Number of bad faces : " << nBadFaces << nl
<< " Number of marked points : " << " Number of marked points : "
<< returnReduce(isErrorPoint.count(), sumOp<unsigned int>()) << returnReduce(isErrorPoint.count(), sumOp<unsigned int>())
<< endl; << endl;
}
} }
return nBadFaces; return nBadFaces;

View File

@ -70,14 +70,18 @@ class polyMeshFilter
//- Dictionary containing the coefficient sub-dictionaries //- Dictionary containing the coefficient sub-dictionaries
const IOdictionary dict_; const IOdictionary dict_;
//- After collapsing, check the mesh quality and redo the collapsing
// iteration if there are too many bad faces in the mesh
Switch controlMeshQuality_;
//- Coefficients for collapsing edges //- Coefficients for collapsing edges
const dictionary& collapseEdgesCoeffDict_; const dictionary& collapseEdgesCoeffDict_;
//- Coefficients for collapsing faces //- Coefficients for collapsing faces
const dictionary& collapseFacesCoeffDict_; dictionary collapseFacesCoeffDict_;
//- Coefficients for controlling the mesh quality //- Coefficients for controlling the mesh quality
const dictionary& meshQualityCoeffDict_; dictionary meshQualityCoeffDict_;
//- Remove edges shorter than this length //- Remove edges shorter than this length
const scalar minLen_; const scalar minLen_;

View File

@ -1226,10 +1226,13 @@ Foam::edgeCollapser::edgeCollapser
) )
: :
mesh_(mesh), mesh_(mesh),
guardFraction_(readScalar(dict.lookup("guardFraction"))), guardFraction_
(
dict.lookupOrDefault<scalar>("guardFraction", 0)
),
maxCollapseFaceToPointSideLengthCoeff_ maxCollapseFaceToPointSideLengthCoeff_
( (
readScalar(dict.lookup("maxCollapseFaceToPointSideLengthCoeff")) dict.lookupOrDefault<scalar>("maxCollapseFaceToPointSideLengthCoeff", 0)
), ),
allowEarlyCollapseToPoint_ allowEarlyCollapseToPoint_
( (
@ -1237,7 +1240,7 @@ Foam::edgeCollapser::edgeCollapser
), ),
allowEarlyCollapseCoeff_ allowEarlyCollapseCoeff_
( (
readScalar(dict.lookup("allowEarlyCollapseCoeff")) dict.lookupOrDefault<scalar>("allowEarlyCollapseCoeff", 0)
) )
{} {}

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -381,8 +381,9 @@ $(porosity)/porosityModel/porosityModelNew.C
$(porosity)/porosityModel/porosityModelList.C $(porosity)/porosityModel/porosityModelList.C
$(porosity)/porosityModel/IOporosityModelList.C $(porosity)/porosityModel/IOporosityModelList.C
$(porosity)/DarcyForchheimer/DarcyForchheimer.C $(porosity)/DarcyForchheimer/DarcyForchheimer.C
$(porosity)/powerLaw/powerLaw.C
$(porosity)/fixedCoeff/fixedCoeff.C $(porosity)/fixedCoeff/fixedCoeff.C
$(porosity)/powerLaw/powerLaw.C
$(porosity)/pressureDrop/pressureDrop.C
MRF = $(general)/MRF MRF = $(general)/MRF
$(MRF)/MRFZone.C $(MRF)/MRFZone.C

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -0,0 +1,143 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "addToRunTimeSelectionTable.H"
#include "pressureDrop.H"
#include "fvMatrices.H"
#include "geometricOneField.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace porosityModels
{
defineTypeNameAndDebug(pressureDrop, 0);
addToRunTimeSelectionTable(porosityModel, pressureDrop, mesh);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::porosityModels::pressureDrop::pressureDrop
(
const word& name,
const word& modelType,
const fvMesh& mesh,
const dictionary& dict,
const word& cellZoneName
)
:
porosityModel(name, modelType, mesh, dict, cellZoneName),
mDotvsDp_(DataEntry<scalar>::New("mDotvsDp", coeffs_)),
lRef_(readScalar(coeffs_.lookup("lRef"))),
rhoName_(coeffs_.lookupOrDefault<word>("rho", "rho"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::porosityModels::pressureDrop::~pressureDrop()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::porosityModels::pressureDrop::correct
(
fvVectorMatrix& UEqn
) const
{
const vectorField& U = UEqn.psi();
const scalarField& V = mesh_.V();
scalarField& Udiag = UEqn.diag();
vectorField& Usource = UEqn.source();
scalar rhoScale = 1.0;
if (UEqn.dimensions() == dimForce)
{
const volScalarField& rho =
mesh_.lookupObject<volScalarField>(rhoName_);
apply(Udiag, Usource, V, rho, U, rhoScale);
}
else
{
coeffs_.lookup("rhoRef") >> rhoScale;
apply(Udiag, Usource, V, geometricOneField(), U, rhoScale);
}
}
void Foam::porosityModels::pressureDrop::correct
(
fvVectorMatrix& UEqn,
const volScalarField& rho,
const volScalarField&
) const
{
const vectorField& U = UEqn.psi();
const scalarField& V = mesh_.V();
scalarField& Udiag = UEqn.diag();
vectorField& Usource = UEqn.source();
apply(Udiag, Usource, V, rho, U, 1.0);
}
void Foam::porosityModels::pressureDrop::correct
(
const fvVectorMatrix& UEqn,
volTensorField& AU
) const
{
const vectorField& U = UEqn.psi();
scalar rhoScale = 1.0;
if (UEqn.dimensions() == dimForce)
{
const volScalarField& rho =
mesh_.lookupObject<volScalarField>(rhoName_);
apply(AU, rho, U, rhoScale);
}
else
{
coeffs_.lookup("rhoRef") >> rhoScale;
apply(AU, geometricOneField(), U, rhoScale);
}
}
void Foam::porosityModels::pressureDrop::writeData(Ostream& os) const
{
os << indent << name_ << endl;
dict_.write(os);
}
// ************************************************************************* //

View File

@ -0,0 +1,203 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::pressureDrop
Description
Pressure drop porosity model, whereby the user speciefies the pressure
drop per unit length as a function of mass flow rate, over a fixed distance.
Example usage:
\verbatim
pressureDropCoeffs
{
coordinateSystem
{
e1 (1 0 0);
e2 (0 1 0);
}
lRef 0.5;
mDotvsDp table
(
(0 0)
(0.2 20)
(0.4 40)
(0.6 65)
(0.8 95)
(1.0 125)
(1.5 220)
(2.0 320)
(2.5 435)
(3.0 560)
(3.5 700)
);
}
\endverbatim
Note
The mDotvsDp entry is a DataEntry type, able to describe the pressure drop
per unit length as a function mass flow rate. The example above gives the
usage for supplying in-line tabulated data.
SeeAlso
Foam::DataEntry
SourceFiles
pressureDrop.C
\*---------------------------------------------------------------------------*/
#ifndef pressureDrop_H
#define pressureDrop_H
#include "porosityModel.H"
#include "coordinateSystem.H"
#include "autoPtr.H"
#include "DataEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace porosityModels
{
/*---------------------------------------------------------------------------*\
Class pressureDrop Declaration
\*---------------------------------------------------------------------------*/
class pressureDrop
:
public porosityModel
{
private:
// Private data
//- Pressure drop per unit length [Pa/m] as a function of
// mass flow rate [kg/s]
autoPtr<DataEntry<scalar> > mDotvsDp_;
//- Distance over which pressure drop is applied
scalar lRef_;
//- Name of density field
word rhoName_;
// Private Member Functions
//- Apply
template<class RhoFieldType>
void apply
(
scalarField& Udiag,
vectorField& Usource,
const scalarField& V,
const RhoFieldType& rho,
const vectorField& U,
const scalar rhoScale
) const;
//- Apply
template<class RhoFieldType>
void apply
(
tensorField& AU,
const RhoFieldType& rho,
const vectorField& U,
const scalar rhoScale
) const;
//- Disallow default bitwise copy construct
pressureDrop(const pressureDrop&);
//- Disallow default bitwise assignment
void operator=(const pressureDrop&);
public:
//- Runtime type information
TypeName("pressureDrop");
//- Constructor
pressureDrop
(
const word& name,
const word& modelType,
const fvMesh& mesh,
const dictionary& dict,
const word& cellZoneName
);
//- Destructor
virtual ~pressureDrop();
// Member Functions
//- Add resistance
virtual void correct(fvVectorMatrix& UEqn) const;
//- Add resistance
virtual void correct
(
fvVectorMatrix& UEqn,
const volScalarField& rho,
const volScalarField& mu
) const;
//- Add resistance
virtual void correct
(
const fvVectorMatrix& UEqn,
volTensorField& AU
) const;
// I-O
//- Write
void writeData(Ostream& os) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace porosityModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "pressureDropTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,89 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
template<class RhoFieldType>
void Foam::porosityModels::pressureDrop::apply
(
scalarField& Udiag,
vectorField& Usource,
const scalarField& V,
const RhoFieldType& rho,
const vectorField& U,
const scalar rhoScale
) const
{
// local-to-global transformation tensor
const tensor& E = coordSys_.R().R();
forAll(cellZoneIds_, zoneI)
{
const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
forAll(cells, i)
{
const label cellI = cells[i];
const scalar magU = mag(U[cellI]);
const scalar mDot = rho[cellI]*magU;
const scalar dp = mDotvsDp_->value(mDot);
const tensor Cd = E*dp/(lRef_*magU*rhoScale + ROOTVSMALL);
const scalar isoCd = tr(Cd);
Udiag[cellI] += V[cellI]*isoCd;
Usource[cellI] -= V[cellI]*((Cd - I*isoCd) & U[cellI]);
}
}
}
template<class RhoFieldType>
void Foam::porosityModels::pressureDrop::apply
(
tensorField& AU,
const RhoFieldType& rho,
const vectorField& U,
const scalar rhoScale
) const
{
// local-to-global transformation tensor
const tensor& E = coordSys_.R().R();
forAll(cellZoneIds_, zoneI)
{
const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
forAll(cells, i)
{
const label cellI = cells[i];
const scalar magU = mag(U[cellI]);
const scalar mDot = rho[cellI]*magU;
const scalar dp = mDotvsDp_->value(mDot);
AU[cellI] += E*dp/(lRef_*magU*rhoScale + ROOTVSMALL);
}
}
}
// ************************************************************************* //

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -127,10 +127,10 @@ bool Foam::PilchErdman<CloudType>::update
scalar rho12 = sqrt(rhoc/rho); scalar rho12 = sqrt(rhoc/rho);
scalar Vd = Urmag*rho12*(B1_*taubBar * B2_*taubBar*taubBar); scalar Vd = Urmag*rho12*(B1_*taubBar + B2_*taubBar*taubBar);
scalar Vd1 = sqr(1.0 - Vd/Urmag); scalar Vd1 = sqr(1.0 - Vd/Urmag);
Vd1 = max(Vd1, SMALL); Vd1 = max(Vd1, SMALL);
scalar Ds = 2.0*Wec*sigma*Vd1/(Vd1*rhoc*sqr(Urmag)); scalar Ds = 2.0*Wec*sigma/(Vd1*rhoc*sqr(Urmag));
scalar A = Urmag*rho12/d; scalar A = Urmag*rho12/d;
scalar taub = taubBar/A; scalar taub = taubBar/A;

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -87,10 +87,8 @@ Foam::localAxesRotation::localAxesRotation
origin_(), origin_(),
e3_() e3_()
{ {
FatalErrorIn FatalErrorIn("localAxesRotation(const dictionary&)")
( << " localAxesRotation can not be contructed from dictionary "
"localAxesRotation(const dictionary&)"
) << " localAxesRotation can not be contructed from dictionary "
<< " use the construtctor : " << " use the construtctor : "
"(" "("
" const dictionary& dict, const objectRegistry& orb" " const dictionary& dict, const objectRegistry& orb"
@ -114,8 +112,7 @@ Foam::vector Foam::localAxesRotation::transform(const vector& st) const
{ {
notImplemented notImplemented
( (
"vector Foam::localAxesRotation:: " "vector Foam::localAxesRotation::transform(const vector&) const"
"transform(const vector& st) const"
); );
return vector::zero; return vector::zero;
} }
@ -125,8 +122,7 @@ Foam::vector Foam::localAxesRotation::invTransform(const vector& st) const
{ {
notImplemented notImplemented
( (
"vector Foam::localAxesRotation:: " "vector Foam::localAxesRotation::invTransform(const vector&) const"
"transform(const vector& st) const"
); );
return vector::zero; return vector::zero;
} }
@ -139,11 +135,9 @@ Foam::tmp<Foam::vectorField> Foam::localAxesRotation::transform
{ {
if (Rptr_->size() != st.size()) if (Rptr_->size() != st.size())
{ {
FatalErrorIn FatalErrorIn("localAxesRotation::transform(const vectorField&)")
( << "vectorField st has different size to tensorField "
"localAxesRotation::transform(const vectorField& st) " << abort(FatalError);
) << "vectorField st has different size to tensorField "
<< abort(FatalError);
} }
return (Rptr_() & st); return (Rptr_() & st);
@ -166,11 +160,9 @@ Foam::tmp<Foam::tensorField> Foam::localAxesRotation::transformTensor
{ {
if (Rptr_->size() != st.size()) if (Rptr_->size() != st.size())
{ {
FatalErrorIn FatalErrorIn("localAxesRotation::transformTensor(const tensorField&)")
( << "tensorField st has different size to tensorField Tr"
"localAxesRotation::transformTensor(const tensorField& st) " << abort(FatalError);
) << "tensorField st has different size to tensorField Tr"
<< abort(FatalError);
} }
return (Rptr_() & st & Rptr_().T()); return (Rptr_() & st & Rptr_().T());
} }
@ -181,10 +173,7 @@ Foam::tensor Foam::localAxesRotation::transformTensor
const tensor& st const tensor& st
) const ) const
{ {
notImplemented notImplemented("tensor localAxesRotation::transformTensor() const");
(
"tensor localAxesRotation::transformTensor() const"
);
return tensor::zero; return tensor::zero;
} }
@ -197,17 +186,15 @@ Foam::tmp<Foam::tensorField> Foam::localAxesRotation::transformTensor
{ {
if (cellMap.size() != st.size()) if (cellMap.size() != st.size())
{ {
FatalErrorIn FatalErrorIn("localAxesRotation::transformTensor(const tensorField&)")
( << "tensorField st has different size to tensorField Tr"
"localAxesRotation::transformTensor(const tensorField& st) " << abort(FatalError);
) << "tensorField st has different size to tensorField Tr"
<< abort(FatalError);
} }
const tensorField Rtr = Rptr_().T(); const tensorField Rtr(Rptr_().T());
tmp<tensorField> tt(new tensorField(cellMap.size())); tmp<tensorField> tt(new tensorField(cellMap.size()));
tensorField& t = tt(); tensorField& t = tt();
forAll (cellMap, i) forAll(cellMap, i)
{ {
const label cellI = cellMap[i]; const label cellI = cellMap[i];
t[i] = Rptr_()[cellI] & st[i] & Rtr[cellI]; t[i] = Rptr_()[cellI] & st[i] & Rtr[cellI];
@ -223,11 +210,9 @@ Foam::tmp<Foam::symmTensorField> Foam::localAxesRotation::transformVector
{ {
if (Rptr_->size() != st.size()) if (Rptr_->size() != st.size())
{ {
FatalErrorIn FatalErrorIn("localAxesRotation::transformVector(const vectorField&)")
( << "tensorField st has different size to tensorField Tr"
"localAxesRotation::transformVector(const vectorField& st) " << abort(FatalError);
) << "tensorField st has different size to tensorField Tr"
<< abort(FatalError);
} }
tmp<symmTensorField> tfld(new symmTensorField(Rptr_->size())); tmp<symmTensorField> tfld(new symmTensorField(Rptr_->size()));

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -48,10 +48,11 @@ namespace Foam
template<> template<>
const char* NamedEnum<fieldValues::faceSource::operationType, 11>::names[] = const char* NamedEnum<fieldValues::faceSource::operationType, 12>::names[] =
{ {
"none", "none",
"sum", "sum",
"sumDirection",
"average", "average",
"weightedAverage", "weightedAverage",
"areaAverage", "areaAverage",
@ -74,7 +75,7 @@ namespace Foam
const Foam::NamedEnum<Foam::fieldValues::faceSource::sourceType, 3> const Foam::NamedEnum<Foam::fieldValues::faceSource::sourceType, 3>
Foam::fieldValues::faceSource::sourceTypeNames_; Foam::fieldValues::faceSource::sourceTypeNames_;
const Foam::NamedEnum<Foam::fieldValues::faceSource::operationType, 11> const Foam::NamedEnum<Foam::fieldValues::faceSource::operationType, 12>
Foam::fieldValues::faceSource::operationTypeNames_; Foam::fieldValues::faceSource::operationTypeNames_;
@ -486,6 +487,46 @@ void Foam::fieldValues::faceSource::writeFileHeader(const label i)
} }
template<>
Foam::scalar Foam::fieldValues::faceSource::processValues
(
const Field<scalar>& values,
const vectorField& Sf,
const scalarField& weightField
) const
{
switch (operation_)
{
case opSumDirection:
{
const vector direction(dict_.lookup("direction"));
scalar v = 0.0;
forAll(Sf, i)
{
scalar d = Sf[i] & direction;
if (d > 0)
{
v += pos(values[i])*values[i];
}
else
{
v += neg(values[i])*values[i];
}
}
return v;
}
default:
{
// Fall through to other operations
return processSameTypeValues(values, Sf, weightField);
}
}
}
template<> template<>
Foam::vector Foam::fieldValues::faceSource::processValues Foam::vector Foam::fieldValues::faceSource::processValues
( (
@ -496,14 +537,19 @@ Foam::vector Foam::fieldValues::faceSource::processValues
{ {
switch (operation_) switch (operation_)
{ {
case opSumDirection:
{
const vector direction(dict_.lookup("direction"));
return sum(pos(values & direction)*values);
}
case opAreaNormalAverage: case opAreaNormalAverage:
{ {
scalar result = sum(values&Sf)/sum(mag(Sf)); scalar result = sum(values & Sf)/sum(mag(Sf));
return vector(result, 0.0, 0.0); return vector(result, 0.0, 0.0);
} }
case opAreaNormalIntegrate: case opAreaNormalIntegrate:
{ {
scalar result = sum(values&Sf); scalar result = sum(values & Sf);
return vector(result, 0.0, 0.0); return vector(result, 0.0, 0.0);
} }
default: default:

View File

@ -2,7 +2,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-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -87,6 +87,7 @@ Description
\plaintable \plaintable
none | no operation none | no operation
sum | sum sum | sum
sumDirection | sum values which are positive in given direction
average | ensemble average average | ensemble average
weightedAverage | weighted average weightedAverage | weighted average
areaAverage | area weighted average areaAverage | area weighted average
@ -176,6 +177,7 @@ public:
{ {
opNone, opNone,
opSum, opSum,
opSumDirection,
opAverage, opAverage,
opWeightedAverage, opWeightedAverage,
opAreaAverage, opAreaAverage,
@ -188,7 +190,7 @@ public:
}; };
//- Operation type names //- Operation type names
static const NamedEnum<operationType, 11> operationTypeNames_; static const NamedEnum<operationType, 12> operationTypeNames_;
private: private:
@ -366,8 +368,17 @@ public:
}; };
//- Specialisation of processing vectors for opAreaNormalAverage, //- Specialisation of processing scalars
// opAreaNormalIntegrate (use inproduct - dimension reducing operation) template<>
scalar faceSource::processValues
(
const Field<scalar>& values,
const vectorField& Sf,
const scalarField& weightField
) const;
//- Specialisation of processing vectors
template<> template<>
vector faceSource::processValues vector faceSource::processValues
( (

View File

@ -2,7 +2,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-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -141,6 +141,26 @@ Type Foam::fieldValues::faceSource::processSameTypeValues
result = sum(values); result = sum(values);
break; break;
} }
case opSumDirection:
{
FatalErrorIn
(
"template<class Type>"
"Type Foam::fieldValues::faceSource::processSameTypeValues"
"("
"const Field<Type>&, "
"const vectorField&, "
"const scalarField&"
") const"
)
<< "Operation " << operationTypeNames_[operation_]
<< " not available for values of type "
<< pTraits<Type>::typeName
<< exit(FatalError);
result = pTraits<Type>::zero;
break;
}
case opAverage: case opAverage:
{ {
result = sum(values)/values.size(); result = sum(values)/values.size();

View File

@ -2,7 +2,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-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -43,6 +43,8 @@ void Foam::fieldValue::read(const dictionary& dict)
{ {
if (active_) if (active_)
{ {
dict_ = dict;
log_ = dict.lookupOrDefault<Switch>("log", false); log_ = dict.lookupOrDefault<Switch>("log", false);
dict.lookup("fields") >> fields_; dict.lookup("fields") >> fields_;
dict.lookup("valueOutput") >> valueOutput_; dict.lookup("valueOutput") >> valueOutput_;
@ -78,6 +80,7 @@ Foam::fieldValue::fieldValue
functionObjectFile(obr, name, valueType), functionObjectFile(obr, name, valueType),
name_(name), name_(name),
obr_(obr), obr_(obr),
dict_(dict),
active_(true), active_(true),
log_(false), log_(false),
sourceName_(dict.lookupOrDefault<word>("sourceName", "sampledSurface")), sourceName_(dict.lookupOrDefault<word>("sourceName", "sampledSurface")),

View File

@ -2,7 +2,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-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -75,6 +75,9 @@ protected:
//- Database this class is registered to //- Database this class is registered to
const objectRegistry& obr_; const objectRegistry& obr_;
//- Construction dictionary
dictionary dict_;
//- Active flag //- Active flag
bool active_; bool active_;
@ -149,6 +152,9 @@ public:
//- Return the reference to the object registry //- Return the reference to the object registry
inline const objectRegistry& obr() const; inline const objectRegistry& obr() const;
//- Return the reference to the construction dictionary
inline const dictionary& dict() const;
//- Return the active flag //- Return the active flag
inline bool active() const; inline bool active() const;

View File

@ -2,7 +2,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-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -40,6 +40,12 @@ inline const Foam::objectRegistry& Foam::fieldValue::obr() const
} }
inline const Foam::dictionary& Foam::fieldValue::dict() const
{
return dict_;
}
inline bool Foam::fieldValue::active() const inline bool Foam::fieldValue::active() const
{ {
return active_; return active_;

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,15 +38,16 @@ namespace Foam
template<> template<>
const char* const char*
NamedEnum<fieldValues::fieldValueDelta::operationType, 4>::names[] = NamedEnum<fieldValues::fieldValueDelta::operationType, 5>::names[] =
{ {
"add", "add",
"subtract", "subtract",
"min", "min",
"max" "max",
"average"
}; };
const NamedEnum<fieldValues::fieldValueDelta::operationType, 4> const NamedEnum<fieldValues::fieldValueDelta::operationType, 5>
fieldValues::fieldValueDelta::operationTypeNames_; fieldValues::fieldValueDelta::operationTypeNames_;
} }
@ -158,7 +159,7 @@ void Foam::fieldValues::fieldValueDelta::write()
if (log_) if (log_)
{ {
Info<< type() << " output:" << endl; Info<< type() << " " << name_ << " output:" << endl;
} }
bool found = false; bool found = false;
@ -179,10 +180,8 @@ void Foam::fieldValues::fieldValueDelta::write()
{ {
Info<< " none" << endl; Info<< " none" << endl;
} }
else
{ Info<< endl;
Info<< endl;
}
} }
} }

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -37,6 +37,8 @@ Description
{ {
type fieldValueDelta; type fieldValueDelta;
functionObjectLibs ("libfieldFunctionObjects.so"); functionObjectLibs ("libfieldFunctionObjects.so");
operation subtract;
fieldValue1 fieldValue1
{ {
... ...
@ -54,6 +56,15 @@ Description
type | type name: fieldValueDelta | yes | type | type name: fieldValueDelta | yes |
\endtable \endtable
\linebreak
The \c operation is one of:
\plaintable
add | add
subtract | subtract
min | minimum
max | maximum
average | average
\endplaintable
SeeAlso SeeAlso
Foam::fieldValue Foam::fieldValue
@ -92,11 +103,12 @@ public:
opAdd, opAdd,
opSubtract, opSubtract,
opMin, opMin,
opMax opMax,
opAverage
}; };
//- Operation type names //- Operation type names
static const NamedEnum<operationType, 4> operationTypeNames_; static const NamedEnum<operationType, 5> operationTypeNames_;
private: private:

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,6 +25,7 @@ License
#include "GeometricField.H" #include "GeometricField.H"
#include "volMesh.H" #include "volMesh.H"
#include "surfaceMesh.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -59,6 +60,11 @@ Type Foam::fieldValues::fieldValueDelta::applyOperation
result = max(value1, value2); result = max(value1, value2);
break; break;
} }
case opAverage:
{
result = 0.5*(value1 + value2);
break;
}
default: default:
{ {
FatalErrorIn FatalErrorIn
@ -83,6 +89,7 @@ template<class Type>
void Foam::fieldValues::fieldValueDelta::processFields(bool& found) void Foam::fieldValues::fieldValueDelta::processFields(bool& found)
{ {
typedef GeometricField<Type, fvPatchField, volMesh> vf; typedef GeometricField<Type, fvPatchField, volMesh> vf;
typedef GeometricField<Type, fvsPatchField, surfaceMesh> sf;
const wordList& fields1 = source1Ptr_->fields(); const wordList& fields1 = source1Ptr_->fields();
@ -95,7 +102,12 @@ void Foam::fieldValues::fieldValueDelta::processFields(bool& found)
forAll(fields1, i) forAll(fields1, i)
{ {
const word& fieldName = fields1[i]; const word& fieldName = fields1[i];
if (obr_.foundObject<vf>(fieldName) && results2.found(fieldName))
if
(
(obr_.foundObject<vf>(fieldName) || obr_.foundObject<sf>(fieldName))
&& results2.found(fieldName)
)
{ {
results1.lookup(fieldName) >> r1; results1.lookup(fieldName) >> r1;
results2.lookup(fieldName) >> r2; results2.lookup(fieldName) >> r2;

View File

@ -2,7 +2,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-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -53,16 +53,14 @@ Foam::noiseFFT::noiseFFT(const fileName& pFileName, const label skip)
scalarField(), scalarField(),
deltat_(0.0) deltat_(0.0)
{ {
// Construct control dictionary // Construct pressure data file
IFstream pFile(pFileName); IFstream pFile(pFileName);
// Check pFile stream is OK // Check pFile stream is OK
if (!pFile.good()) if (!pFile.good())
{ {
FatalErrorIn FatalErrorIn("noiseFFT::noiseFFT(const scalar, const scalarField&)")
( << "Cannot read file " << pFileName
"noiseFFT::noiseFFT(const fileName&, const label)"
) << "Cannot read file " << pFileName
<< exit(FatalError); << exit(FatalError);
} }
@ -76,7 +74,10 @@ Foam::noiseFFT::noiseFFT(const fileName& pFileName, const label skip)
if (!pFile.good() || pFile.eof()) if (!pFile.good() || pFile.eof())
{ {
FatalErrorIn("noiseFFT::noiseFFT(const fileName&, const label)") FatalErrorIn
(
"noiseFFT::noiseFFT(const scalar, const scalarField&)"
)
<< "Number of points in file " << pFileName << "Number of points in file " << pFileName
<< " is less than the number to be skipped = " << skip << " is less than the number to be skipped = " << skip
<< exit(FatalError); << exit(FatalError);

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -336,15 +336,17 @@ Foam::nastranSurfaceWriter::nastranSurfaceWriter()
: :
surfaceWriter(), surfaceWriter(),
writeFormat_(wfShort), writeFormat_(wfShort),
fieldMap_() fieldMap_(),
scale_(1.0)
{} {}
Foam::nastranSurfaceWriter::nastranSurfaceWriter(const dictionary& options) Foam::nastranSurfaceWriter::nastranSurfaceWriter(const dictionary& options)
: :
surfaceWriter(), surfaceWriter(),
writeFormat_(wfShort), writeFormat_(wfLong),
fieldMap_() fieldMap_(),
scale_(options.lookupOrDefault("scale", 1.0))
{ {
if (options.found("format")) if (options.found("format"))
{ {

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -75,6 +75,9 @@ private:
//- Map of OpenFOAM field name vs nastran field name //- Map of OpenFOAM field name vs nastran field name
HashTable<word> fieldMap_; HashTable<word> fieldMap_;
//- Scale to apply to values (default = 1.0)
scalar scale_;
// Private Member Functions // Private Member Functions

View File

@ -2,7 +2,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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -46,6 +46,8 @@ void Foam::nastranSurfaceWriter::writeFaceValue
label SID = 1; label SID = 1;
Type scaledValue = scale_*value;
switch (writeFormat_) switch (writeFormat_)
{ {
case wfShort: case wfShort:
@ -59,7 +61,7 @@ void Foam::nastranSurfaceWriter::writeFaceValue
for (direction dirI = 0; dirI < pTraits<Type>::nComponents; dirI++) for (direction dirI = 0; dirI < pTraits<Type>::nComponents; dirI++)
{ {
os << setw(8) << component(value, dirI); os << setw(8) << component(scaledValue, dirI);
} }
os.unsetf(ios_base::right); os.unsetf(ios_base::right);
@ -77,7 +79,7 @@ void Foam::nastranSurfaceWriter::writeFaceValue
for (direction dirI = 0; dirI < pTraits<Type>::nComponents; dirI++) for (direction dirI = 0; dirI < pTraits<Type>::nComponents; dirI++)
{ {
os << setw(16) << component(value, dirI); os << setw(16) << component(scaledValue, dirI);
} }
os.unsetf(ios_base::right); os.unsetf(ios_base::right);
@ -98,7 +100,7 @@ void Foam::nastranSurfaceWriter::writeFaceValue
for (direction dirI = 0; dirI < pTraits<Type>::nComponents; dirI++) for (direction dirI = 0; dirI < pTraits<Type>::nComponents; dirI++)
{ {
os << ',' << component(value, dirI); os << ',' << component(scaledValue, dirI);
} }
break; break;

View File

@ -22,62 +22,6 @@ collapseEdgesCoeffs
// The maximum angle between two edges that share a point attached to // The maximum angle between two edges that share a point attached to
// no other edges // no other edges
maximumMergeAngle 5; maximumMergeAngle 5;
// The amount that minimumEdgeLength will be reduced by for each
// edge if that edge's collapse generates a poor quality face
reductionFactor 0.5;
}
collapseFacesCoeffs
{
// The initial face length factor
initialFaceLengthFactor 0.5;
// The amount that initialFaceLengthFactor will be reduced by for each
// face if its collapse generates a poor quality face
reductionFactor $initialFaceLengthFactor;
// If the face can't be collapsed to an edge, and it has a span less than
// the target face length multiplied by this coefficient, collapse it
// to a point.
maxCollapseFaceToPointSideLengthCoeff 0.3;
// Allow early collapse of edges to a point
allowEarlyCollapseToPoint on;
// Fraction to premultiply maxCollapseFaceToPointSideLengthCoeff by if
// allowEarlyCollapseToPoint is enabled
allowEarlyCollapseCoeff 0.2;
// Defining how close to the midpoint (M) of the projected
// vertices line a projected vertex (X) can be before making this
// an invalid edge collapse
//
// X---X-g----------------M----X-----------g----X--X
//
// Only allow a collapse if all projected vertices are outwith
// guardFraction (g) of the distance form the face centre to the
// furthest vertex in the considered direction
guardFraction 0.1;
}
meshQualityCoeffs
{
// Name of the dictionary that has the mesh quality coefficients used
// by motionSmoother::checkMesh
#include "meshQualityDict";
// Maximum number of smoothing iterations for the reductionFactors
maximumSmoothingIterations 2;
// Maximum number of outer iterations is mesh quality checking is enabled
maximumIterations 10;
// Maximum number of iterations deletion of a point can cause a bad face
// to be constructed before it is forced to not be deleted
maxPointErrorCount 5;
} }

View File

@ -1,67 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object meshQualityDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Maximum non-orthogonality allowed. Set to 180 to disable.
maxNonOrtho 180;
//- Max skewness allowed. Set to <0 to disable.
maxBoundarySkewness 50;
//- Max skewness allowed. Set to <0 to disable.
maxInternalSkewness 10;
//- Max concaveness allowed. Is angle (in degrees) below which concavity
// is allowed. 0 is straight face, <0 would be convex face.
// Set to 180 to disable.
maxConcave 80;
//- Minimum pyramid volume. Is absolute volume of cell pyramid.
// Set to a sensible fraction of the smallest cell volume expected.
// Set to very negative number (e.g. -1E30) to disable.
minVol 1e-20;
//- Minimum quality of the tet formed by the face-centre
// and variable base point minimum decomposition triangles and
// the cell centre. This has to be a positive number for tracking
// to work. Set to very negative number (e.g. -1E30) to
// disable.
// <0 = inside out tet,
// 0 = flat tet
// 1 = regular tet
minTetQuality 1e-30;
//- Minimum face area. Set to <0 to disable.
minArea -1;
//- Minimum face twist. Set to <-1 to disable. dot product of face normal
//- and face centre triangles normal
minTwist 0.0;
//- minimum normalised cell determinant
//- 1 = hex, <= 0 = folded or flattened illegal cell
minDeterminant 0.001;
//- minFaceWeight (0 -> 0.5)
minFaceWeight 0.02;
//- minVolRatio (0 -> 1)
minVolRatio 0.01;
//must be >0 for Fluent compatibility
minTriangleTwist -1;
// ************************************************************************* //

View File

@ -10,34 +10,41 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class dictionary;
location "constant"; location "system";
object porosityProperties; object fvOptions;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
porosity1 porosity1
{ {
type DarcyForchheimer; type explicitPorositySource;
active yes; active yes;
selectionMode cellZone;
cellZone stator; cellZone stator;
DarcyForchheimerCoeffs explicitPorositySourceCoeffs
{ {
d d [0 -2 0 0 0 0 0] (1e5 -1000 -1000); type DarcyForchheimer;
f f [0 -1 0 0 0 0 0] (0 0 0);
coordinateSystem DarcyForchheimerCoeffs
{ {
type cartesian; d d [0 -2 0 0 0 0 0] (1e5 -1000 -1000);
origin (0 0 0); f f [0 -1 0 0 0 0 0] (0 0 0);
coordinateRotation
coordinateSystem
{ {
type axesRotation; type cartesian;
e1 (1 0 0); origin (0 0 0);
e2 (0 1 0); coordinateRotation
{
type axesRotation;
e1 (1 0 0);
e2 (0 1 0);
}
} }
} }
} }
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -18,7 +18,7 @@ FoamFile
porosity1 porosity1
{ {
type explicitPorositySource; type explicitPorositySource;
active false; active true;
selectionMode cellZone; selectionMode cellZone;
cellZone porosity; cellZone porosity;
@ -47,4 +47,4 @@ porosity1
} }
//************************************************************************* // // ************************************************************************* //

View File

@ -65,4 +65,4 @@ porosity1
} }
//************************************************************************* // //***************************************************************************//

View File

@ -69,7 +69,7 @@ MRF1
{ {
origin (0.25 0.25 0.25); origin (0.25 0.25 0.25);
axis (0 0 1); axis (0 0 1);
omega 5.305; // 500 rpm omega 477.5; // 500 rpm
} }
} }

View File

@ -10,8 +10,7 @@ forceCoeffs1
{ {
type forceCoeffs; type forceCoeffs;
functionObjectLibs ( "libforces.so" ); functionObjectLibs ( "libforces.so" );
outputControl timeStep; outputControl outputTime;
outputInterval 1;
log yes; log yes;
patches ( "motorBike.*" ); patches ( "motorBike.*" );

View File

@ -13,7 +13,7 @@ runApplication blockMesh
runApplication topoSet runApplication topoSet
# create baffles and fields # create baffles and fields
createBaffles -overwrite runApplication createBaffles -overwrite
runApplication $application runApplication $application

View File

@ -1,44 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object porosityProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
filter1
{
cellZone filter;
active true;
type DarcyForchheimer;
DarcyForchheimerCoeffs
{
d d [0 -2 0 0 0 0 0] (500000 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0);
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 0 0);
e2 (0 1 0);
}
}
}
}
// ************************************************************************* //

View File

@ -15,6 +15,32 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
filter1
{
type explicitPorositySource;
selectionMode cellZone;
cellZone filter;
active true;
explicitPorositySourceCoeffs
{
type DarcyForchheimer;
DarcyForchheimerCoeffs
{
d d [0 -2 0 0 0 0 0] (500000 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0);
coordinateSystem
{
e1 (1 0 0);
e2 (0 1 0);
}
}
}
}
massSource1 massSource1
{ {
type scalarSemiImplicitSource; type scalarSemiImplicitSource;