Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Mark Olesen 2017-03-10 13:30:39 +01:00
commit 31555346cc
17 changed files with 64 additions and 96 deletions

View File

@ -75,8 +75,8 @@ int main(int argc, char *argv[])
wre.info(Info) << " after DETECT" << endl;
wre.uncompile();
wre.info(Info) << " uncompiled" << endl;
wre.recompile();
wre.info(Info) << " recompiled" << endl;
wre.compile();
wre.info(Info) << " re-compiled" << endl;
wre.set("something .* value", wordRe::LITERAL);
wre.info(Info) << " set as LITERAL" << endl;

View File

@ -4,7 +4,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
@ -55,6 +55,7 @@ usage: ${0##*/}
-metis-path dir specify 'METIS_ARCH_PATH'
-paraview ver specify 'ParaView_VERSION' (eg, 5.0.1)
-paraview-path dir specify 'ParaView_DIR' (eg, /opt/paraviewopenfoam3120)
-mpi name specify type for 'WM_MPLIB' (eg, FJMPI, INTELMPI, etc)
-openmpi ver specify ThirdParty openmpi version for 'FOAM_MPI'
-openmpi-system activate system openmpi
-openmpi-third activate ThirdParty openmpi (using default version)
@ -338,6 +339,15 @@ do
shift
;;
-mpi)
# Explicitly set WM_MPLIB=...
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
replace etc/bashrc WM_MPLIB "$2"
optMpi=system
adjusted=true
shift
;;
-openmpi)
# Replace FOAM_MPI=openmpi-<digits>.. and set to use third-party
# The edit is slightly fragile, but works

View File

@ -39,8 +39,8 @@ Description
Note
If the string contents are changed - eg, by the operator+=() or by
string::replace(), etc - it will be necessary to use compile() or
recompile() to synchronize the regular expression.
string::replace(), etc - it will be necessary to use compile() to
synchronize the regular expression.
SourceFiles
wordRe.C
@ -161,9 +161,6 @@ public:
//- Possibly compile the regular expression, with greater control
inline bool compile(const compOption) const;
//- Recompile an existing regular expression
inline bool recompile() const;
//- Frees precompiled regular expression, making wordRe a literal.
// Optionally strips invalid word characters
inline void uncompile(const bool doStripInvalid = false) const;

View File

@ -165,17 +165,6 @@ inline bool Foam::wordRe::compile() const
}
inline bool Foam::wordRe::recompile() const
{
if (re_.exists())
{
re_ = *this;
}
return re_.exists();
}
inline void Foam::wordRe::uncompile(const bool doStripInvalid) const
{
if (re_.clear())
@ -265,6 +254,10 @@ inline void Foam::wordRe::operator=(const keyType& str)
{
compile();
}
else
{
re_.clear();
}
}

View File

@ -78,7 +78,7 @@ Foam::temperatureCoupledBase::temperatureCoupledBase
patch_(patch),
method_(KMethodTypeNames_.read(dict.lookup("kappaMethod"))),
kappaName_(dict.lookupOrDefault<word>("kappa", "none")),
alphaAniName_(dict.lookupOrDefault<word>("alphaAni","Anialpha"))
alphaAniName_(dict.lookupOrDefault<word>("alphaAni","none"))
{}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -159,13 +159,6 @@ Foam::tmp<Foam::Field<Type>> Foam::slicedFvPatchField<Type>::snGrad() const
}
template<class Type>
void Foam::slicedFvPatchField<Type>::updateCoeffs()
{
NotImplemented;
}
template<class Type>
Foam::tmp<Foam::Field<Type>>
Foam::slicedFvPatchField<Type>::patchInternalField() const

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -153,10 +153,6 @@ public:
//- Return patch-normal gradient
virtual tmp<Field<Type>> snGrad() const;
//- Update the coefficients associated with the patch field
// Sets Updated to true
virtual void updateCoeffs();
//- Return internal field next to patch as patch field
virtual tmp<Field<Type>> patchInternalField() const;

View File

@ -277,13 +277,13 @@ bool Foam::functionObjects::scalarTransport::execute()
const volScalarField& alpha =
mesh_.lookupObject<volScalarField>(phaseName_);
const surfaceScalarField& limitedPhiAlpa =
const surfaceScalarField& limitedPhiAlpha =
mesh_.lookupObject<surfaceScalarField>(phasePhiCompressedName_);
D *= pos(alpha - 0.99);
// Reset D dimensions consistent with limitedPhiAlpa
D.dimensions().reset(limitedPhiAlpa.dimensions()/dimLength);
// Reset D dimensions consistent with limitedPhiAlpha
D.dimensions().reset(limitedPhiAlpha.dimensions()/dimLength);
// Solve
tmp<surfaceScalarField> tTPhiUD;
@ -292,7 +292,7 @@ bool Foam::functionObjects::scalarTransport::execute()
fvScalarMatrix sEqn
(
fvm::ddt(s)
+ fvm::div(limitedPhiAlpa, s, divScheme)
+ fvm::div(limitedPhiAlpha, s, divScheme)
- fvm::laplacian(D, s, laplacianScheme)
==
alpha*fvOptions_(s)

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -29,6 +29,7 @@ License
#include "HashSet.H"
#include "surfaceInterpolate.H"
#include "zeroGradientFvPatchFields.H"
#include "wallDist.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -68,42 +69,18 @@ Foam::inverseDistanceDiffusivity::~inverseDistanceDiffusivity()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::scalarField> Foam::inverseDistanceDiffusivity::y() const
{
labelHashSet patchSet(mesh().boundaryMesh().patchSet(patchNames_));
if (patchSet.size())
{
return tmp<scalarField>
(
new scalarField(patchWave(mesh(), patchSet, false).distance())
);
}
else
{
return tmp<scalarField>(new scalarField(mesh().nCells(), 1.0));
}
}
void Foam::inverseDistanceDiffusivity::correct()
{
volScalarField y_
(
IOobject
faceDiffusivity_ =
1.0
/fvc::interpolate
(
"y",
mesh().time().timeName(),
mesh()
),
mesh(),
dimless,
zeroGradientFvPatchScalarField::typeName
);
y_.primitiveFieldRef() = y();
y_.correctBoundaryConditions();
faceDiffusivity_ = 1.0/fvc::interpolate(y_);
wallDist::New
(
mesh(),
mesh().boundaryMesh().patchSet(patchNames_)
).y()
);
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -60,8 +60,6 @@ class inverseDistanceDiffusivity
// Private Member Functions
//- Return patch-cell-centre distance field
tmp<scalarField> y() const;
//- Disallow default bitwise copy construct
inverseDistanceDiffusivity(const inverseDistanceDiffusivity&);

View File

@ -206,6 +206,12 @@ void Foam::solarCalculator::init()
}
case mSunLoadFairWeatherConditions:
{
dict_.readIfPresent
(
"skyCloudCoverFraction",
skyCloudCoverFraction_
);
A_ = readScalar(dict_.lookup("A"));
B_ = readScalar(dict_.lookup("B"));
@ -218,7 +224,9 @@ void Foam::solarCalculator::init()
calculateBetaTetha();
}
directSolarRad_ = A_/exp(B_/sin(beta_));
directSolarRad_ =
(1.0 - 0.75*pow(skyCloudCoverFraction_, 3.0))
* A_/exp(B_/sin(beta_));
groundReflectivity_ =
readScalar(dict_.lookup("groundReflectivity"));
@ -257,6 +265,7 @@ Foam::solarCalculator::solarCalculator
B_(0.0),
beta_(0.0),
tetha_(0.0),
skyCloudCoverFraction_(0.0),
Setrn_(0.0),
SunPrime_(0.0),
C_(readScalar(dict.lookup("C"))),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-2017 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -52,6 +52,7 @@ Description
2) SunLoadFairWeatherConditions: The solar fluxes are calculated following
the Fair Weather Conditions Method from the ASHRAE Handbook. The entries
are:
skyCloudCoverFraction: Fraction of sky covered by clouds (0-1)
A : Apparent solar irradiation at air mass m = 0
B : Atmospheric extinction coefficient
beta: Solar altitude (in degrees) above the horizontal. This
@ -61,7 +62,8 @@ Description
In this model the flux is calculated as:
directSolarRad = A/exp(B/sin(beta));
directSolarRad =
(1 - 0.75*skyCloudCoverFraction^3)*A/exp(B/sin(beta));
3) SunLoadTheoreticalMaximum: The entries are:
Setrn
@ -158,6 +160,9 @@ private:
scalar beta_;
scalar tetha_;
//- Sky cloud cover fraction [0-1]
scalar skyCloudCoverFraction_;
//- Maximum theoretical direct solar load model parameters
scalar Setrn_;

View File

@ -9,25 +9,16 @@ FoamFile
{
version 2.0;
format ascii;
class volScalarField;
class dictionary;
location "constant";
object boundaryRadiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
".*"
{
".*"
{
type boundaryRadiation;
mode lookup;
emissivity uniform 1.0;
absorptivity uniform 0.0;
value uniform 0.0;
}
mode lookup;
emissivity 1.0;
}
// ************************************************************************* //

View File

@ -21,7 +21,7 @@ done
for i in air solid floor
do
changeDictionary -region $i > log.changeDictionary.$i 2>&1
runApplication -s $i changeDictionary -region $i -subDict dictionaryReplacement
done
# -----------------------------------------------------------------------------

View File

@ -29,7 +29,7 @@ dynamicRefineFvMeshCoeffs
// Have slower than 2:1 refinement
nBufferLayers 1;
// Refine cells only up to maxRefinement levels
maxRefinement 3;
maxRefinement 4;
// Stop refinement if maxCells reached
maxCells 2000000;
// Flux field and corresponding velocity field. Fluxes on changed

View File

@ -38,7 +38,7 @@ geometry
//// Optional: avoid patch-face merging. Allows mesh to be used for
//// refinement/unrefinement
//mergePatchFaces off; // default on
mergePatchFaces on; // default on

View File

@ -15,8 +15,7 @@ runApplication splitMeshRegions -cellZones -overwrite
for i in bottomAir topAir heater leftSolid rightSolid
do
runApplication changeDictionary -region $i
mv log.changeDictionary log.changeDictionary.$i 2>&1
runApplication -s $i changeDictionary -region $i -subDict dictionaryReplacement
done
runApplication decomposePar -allRegions