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 "rhoCombustionModel.H"
#include "radiationModel.H"
#include "IOporosityModelList.H"
#include "fvIOoptionList.H"
#include "SLGThermo.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
{
// Edges shorter than this absolute value will be merged
@ -22,10 +27,6 @@ collapseEdgesCoeffs
// The maximum angle between two edges that share a point attached to
// no other edges
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;
}
@ -34,10 +35,6 @@ 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.
@ -63,12 +60,20 @@ collapseFacesCoeffs
}
meshQualityCoeffs
controlMeshQualityCoeffs
{
// Name of the dictionary that has the mesh quality coefficients used
// by motionSmoother::checkMesh
#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
maximumSmoothingIterations 2;

View File

@ -427,9 +427,13 @@ Foam::polyMeshFilter::polyMeshFilter(const fvMesh& mesh)
IOobject::NO_WRITE
)
),
controlMeshQuality_
(
dict_.lookupOrDefault<Switch>("controlMeshQuality", false)
),
collapseEdgesCoeffDict_(dict_.subDict("collapseEdgesCoeffs")),
collapseFacesCoeffDict_(dict_.subDict("collapseFacesCoeffs")),
meshQualityCoeffDict_(dict_.subDict("meshQualityCoeffs")),
collapseFacesCoeffDict_(dict_.subOrEmptyDict("collapseFacesCoeffs")),
meshQualityCoeffDict_(dict_.subOrEmptyDict("controlMeshQualityCoeffs")),
minLen_(readScalar(collapseEdgesCoeffDict_.lookup("minimumEdgeLength"))),
maxCos_
(
@ -443,27 +447,39 @@ Foam::polyMeshFilter::polyMeshFilter(const fvMesh& mesh)
),
edgeReductionFactor_
(
readScalar(collapseEdgesCoeffDict_.lookup("reductionFactor"))
meshQualityCoeffDict_.lookupOrDefault<scalar>("edgeReductionFactor", -1)
),
maxIterations_
(
readLabel(meshQualityCoeffDict_.lookup("maximumIterations"))
meshQualityCoeffDict_.lookupOrAddDefault<label>("maximumIterations", 1)
),
maxSmoothIters_
(
readLabel(meshQualityCoeffDict_.lookup("maximumSmoothingIterations"))
meshQualityCoeffDict_.lookupOrAddDefault<label>
(
"maximumSmoothingIterations",
0
)
),
initialFaceLengthFactor_
(
readScalar(collapseFacesCoeffDict_.lookup("initialFaceLengthFactor"))
collapseFacesCoeffDict_.lookupOrAddDefault<scalar>
(
"initialFaceLengthFactor",
-1
)
),
faceReductionFactor_
(
readScalar(collapseFacesCoeffDict_.lookup("reductionFactor"))
meshQualityCoeffDict_.lookupOrAddDefault<scalar>
(
"faceReductionFactor",
-1
)
),
maxPointErrorCount_
(
readLabel(meshQualityCoeffDict_.lookup("maxPointErrorCount"))
meshQualityCoeffDict_.lookupOrAddDefault<label>("maxPointErrorCount", 0)
),
minEdgeLen_(),
faceFilterFactor_()
@ -547,23 +563,10 @@ Foam::label Foam::polyMeshFilter::filter(const label nOriginalBadFaces)
Map<point> collapsePointToLocation(newMesh.nPoints());
// Mark points on boundary
const labelList boundaryPoint = findBoundaryPoints
(
newMesh//,
// boundaryIOPts
);
const labelList boundaryPoint = findBoundaryPoints(newMesh);
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
labelPair nCollapsedPtEdge = collapser.markSmallSliverFaces
@ -832,6 +835,8 @@ Foam::label Foam::polyMeshFilter::filter(const label nOriginalBadFaces)
// Do not allow collapses in regions of error.
// Updates minEdgeLen, nRelaxedEdges
if (controlMeshQuality_)
{
PackedBoolList isErrorPoint(newMesh.nPoints());
nBadFaces = edgeCollapser::checkMeshQuality
(
@ -868,6 +873,11 @@ Foam::label Foam::polyMeshFilter::filter(const label nOriginalBadFaces)
pointErrorCount
);
}
else
{
return -1;
}
}
return nBadFaces;
}
@ -931,11 +941,7 @@ Foam::label Foam::polyMeshFilter::filterEdges
Map<point> collapsePointToLocation(newMesh.nPoints());
// Mark points on boundary
const labelList boundaryPoint = findBoundaryPoints
(
newMesh//,
// boundaryIOPts
);
const labelList boundaryPoint = findBoundaryPoints(newMesh);
edgeCollapser collapser(newMesh, collapseFacesCoeffDict_);
@ -1059,6 +1065,8 @@ Foam::label Foam::polyMeshFilter::filterEdges
// Do not allow collapses in regions of error.
// Updates minEdgeLen, nRelaxedEdges
if (controlMeshQuality_)
{
PackedBoolList isErrorPoint(newMesh.nPoints());
nBadFaces = edgeCollapser::checkMeshQuality
(
@ -1087,6 +1095,11 @@ Foam::label Foam::polyMeshFilter::filterEdges
pointErrorCount
);
}
else
{
return -1;
}
}
return nBadFaces;
}
@ -1174,6 +1187,8 @@ Foam::label Foam::polyMeshFilter::filterIndirectPatchFaces()
// Do not allow collapses in regions of error.
// Updates minEdgeLen, nRelaxedEdges
if (controlMeshQuality_)
{
PackedBoolList isErrorPoint(newMesh.nPoints());
nBadFaces = edgeCollapser::checkMeshQuality
(
@ -1187,6 +1202,7 @@ Foam::label Foam::polyMeshFilter::filterIndirectPatchFaces()
<< returnReduce(isErrorPoint.count(), sumOp<unsigned int>())
<< endl;
}
}
return nBadFaces;
}

View File

@ -70,14 +70,18 @@ class polyMeshFilter
//- Dictionary containing the coefficient sub-dictionaries
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
const dictionary& collapseEdgesCoeffDict_;
//- Coefficients for collapsing faces
const dictionary& collapseFacesCoeffDict_;
dictionary collapseFacesCoeffDict_;
//- Coefficients for controlling the mesh quality
const dictionary& meshQualityCoeffDict_;
dictionary meshQualityCoeffDict_;
//- Remove edges shorter than this length
const scalar minLen_;

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -127,10 +127,10 @@ bool Foam::PilchErdman<CloudType>::update
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);
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 taub = taubBar/A;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -48,10 +48,11 @@ namespace Foam
template<>
const char* NamedEnum<fieldValues::faceSource::operationType, 11>::names[] =
const char* NamedEnum<fieldValues::faceSource::operationType, 12>::names[] =
{
"none",
"sum",
"sumDirection",
"average",
"weightedAverage",
"areaAverage",
@ -74,7 +75,7 @@ namespace Foam
const Foam::NamedEnum<Foam::fieldValues::faceSource::sourceType, 3>
Foam::fieldValues::faceSource::sourceTypeNames_;
const Foam::NamedEnum<Foam::fieldValues::faceSource::operationType, 11>
const Foam::NamedEnum<Foam::fieldValues::faceSource::operationType, 12>
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<>
Foam::vector Foam::fieldValues::faceSource::processValues
(
@ -496,14 +537,19 @@ Foam::vector Foam::fieldValues::faceSource::processValues
{
switch (operation_)
{
case opSumDirection:
{
const vector direction(dict_.lookup("direction"));
return sum(pos(values & direction)*values);
}
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);
}
case opAreaNormalIntegrate:
{
scalar result = sum(values&Sf);
scalar result = sum(values & Sf);
return vector(result, 0.0, 0.0);
}
default:

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -141,6 +141,26 @@ Type Foam::fieldValues::faceSource::processSameTypeValues
result = sum(values);
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:
{
result = sum(values)/values.size();

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -75,6 +75,9 @@ protected:
//- Database this class is registered to
const objectRegistry& obr_;
//- Construction dictionary
dictionary dict_;
//- Active flag
bool active_;
@ -149,6 +152,9 @@ public:
//- Return the reference to the object registry
inline const objectRegistry& obr() const;
//- Return the reference to the construction dictionary
inline const dictionary& dict() const;
//- Return the active flag
inline bool active() const;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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
{
return active_;

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -336,15 +336,17 @@ Foam::nastranSurfaceWriter::nastranSurfaceWriter()
:
surfaceWriter(),
writeFormat_(wfShort),
fieldMap_()
fieldMap_(),
scale_(1.0)
{}
Foam::nastranSurfaceWriter::nastranSurfaceWriter(const dictionary& options)
:
surfaceWriter(),
writeFormat_(wfShort),
fieldMap_()
writeFormat_(wfLong),
fieldMap_(),
scale_(options.lookupOrDefault("scale", 1.0))
{
if (options.found("format"))
{

View File

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

View File

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

View File

@ -22,62 +22,6 @@ collapseEdgesCoeffs
// The maximum angle between two edges that share a point attached to
// no other edges
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,17 +10,22 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "constant";
object porosityProperties;
location "system";
object fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
porosity1
{
type DarcyForchheimer;
type explicitPorositySource;
active yes;
selectionMode cellZone;
cellZone stator;
explicitPorositySourceCoeffs
{
type DarcyForchheimer;
DarcyForchheimerCoeffs
{
d d [0 -2 0 0 0 0 0] (1e5 -1000 -1000);
@ -38,6 +43,8 @@ porosity1
}
}
}
}
}
// ************************************************************************* //

View File

@ -18,7 +18,7 @@ FoamFile
porosity1
{
type explicitPorositySource;
active false;
active true;
selectionMode cellZone;
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);
axis (0 0 1);
omega 5.305; // 500 rpm
omega 477.5; // 500 rpm
}
}

View File

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

View File

@ -13,7 +13,7 @@ runApplication blockMesh
runApplication topoSet
# create baffles and fields
createBaffles -overwrite
runApplication createBaffles -overwrite
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
{
type scalarSemiImplicitSource;