Merge branch 'master' into develop
This commit is contained in:
commit
616b91c06e
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
||||
fft::reverseTransform
|
||||
(
|
||||
K/(mag(K) + 1.0e-6) ^ forceGen.newField(), K.nn()
|
||||
)
|
||||
)*recRootN
|
||||
);
|
||||
|
||||
#include "globalProperties.H"
|
||||
|
@ -19,3 +19,10 @@
|
||||
|
||||
Kmesh K(mesh);
|
||||
UOprocess forceGen(K, runTime.deltaTValue(), turbulenceProperties);
|
||||
|
||||
label ntot = 1;
|
||||
forAll(K.nn(), idim)
|
||||
{
|
||||
ntot *= K.nn()[idim];
|
||||
}
|
||||
const scalar recRootN = 1.0/Foam::sqrt(scalar(ntot));
|
||||
|
@ -55,8 +55,8 @@ Usage
|
||||
}
|
||||
|
||||
|
||||
// Input file
|
||||
inputFile "postProcessing/faceSource1/surface/patch/patch.case";
|
||||
// Input files list
|
||||
files ("postProcessing/faceSource1/surface/patch/patch.case";)
|
||||
|
||||
// Surface reader
|
||||
reader ensight;
|
||||
|
@ -121,7 +121,24 @@ Foam::scalar Foam::Random::position
|
||||
template<>
|
||||
Foam::label Foam::Random::position(const label& start, const label& end)
|
||||
{
|
||||
return start + round(scalar01()*(end - start));
|
||||
#ifdef FULLDEBUG
|
||||
if (start > end)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "start index " << start << " > end index " << end << nl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Extend the upper sampling range by 1 and floor the result.
|
||||
// Since the range is non-negative, can use integer truncation
|
||||
// instead using floor().
|
||||
|
||||
const label val = start + label(scalar01()*(end - start + 1));
|
||||
|
||||
// Rare case when scalar01() returns exactly 1.000 and the truncated
|
||||
// value would be out of range.
|
||||
return min(val, end);
|
||||
}
|
||||
|
||||
|
||||
@ -200,12 +217,12 @@ Foam::scalar Foam::Random::globalPosition
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
value = scalar01()*(end - start);
|
||||
value = position<scalar>(start, end);
|
||||
}
|
||||
|
||||
Pstream::scatter(value);
|
||||
|
||||
return start + value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
@ -220,12 +237,12 @@ Foam::label Foam::Random::globalPosition
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
value = round(scalar01()*(end - start));
|
||||
value = position<label>(start, end);
|
||||
}
|
||||
|
||||
Pstream::scatter(value);
|
||||
|
||||
return start + value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
|
@ -100,6 +100,12 @@ public:
|
||||
//- Calculate time scale
|
||||
virtual tmp<volScalarField> timeScale() = 0;
|
||||
|
||||
//- Return the CEDC coefficient
|
||||
scalar CEDC() const
|
||||
{
|
||||
return CEDC_;
|
||||
}
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
|
@ -39,6 +39,7 @@ SourceFiles
|
||||
#define singleStepCombustion_H
|
||||
|
||||
#include "singleStepReactingMixture.H"
|
||||
#include "fvScalarMatrix.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -180,7 +180,7 @@ Foam::scalar Foam::COxidationIntrinsicRate<CloudType>::calculate
|
||||
max(0.5*d*sqrt(Sb_*rhop*Ag_*ki*ppO2/(De*rhoO2)), ROOTVSMALL);
|
||||
|
||||
// Effectiveness factor []
|
||||
const scalar eta = max(3.0*sqr(phi)*(phi/tanh(phi) - 1.0), 0.0);
|
||||
const scalar eta = max(3.0/sqr(phi)*(phi/tanh(phi) - 1.0), 0.0);
|
||||
|
||||
// Chemical rate [kmol/m2/s]
|
||||
const scalar R = eta*d/6.0*rhop*Ag_*ki;
|
||||
|
@ -198,12 +198,12 @@ Foam::label Foam::ConeInjection<CloudType>::parcelsToInject
|
||||
{
|
||||
const scalar targetVolume = flowRateProfile_.integrate(0, time1);
|
||||
|
||||
const scalar volumeFraction = targetVolume/this->volumeTotal_;
|
||||
|
||||
const label targetParcels =
|
||||
parcelsPerInjector_*targetVolume/this->volumeTotal_;
|
||||
ceil(positionAxis_.size()*parcelsPerInjector_*volumeFraction);
|
||||
|
||||
const label nToInject = targetParcels - nInjected_;
|
||||
|
||||
return positionAxis_.size()*nToInject;
|
||||
return targetParcels - nInjected_;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -214,7 +214,7 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
|
||||
|
||||
while(magTangent < SMALL)
|
||||
{
|
||||
vector v = rndGen.sample01<vector>();
|
||||
vector v = rndGen.globalSample01<vector>();
|
||||
|
||||
tangent = v - (v & direction_)*direction_;
|
||||
magTangent = mag(tangent);
|
||||
@ -354,7 +354,7 @@ void Foam::ConeNozzleInjection<CloudType>::setPositionAndCell
|
||||
{
|
||||
Random& rndGen = this->owner().rndGen();
|
||||
|
||||
scalar beta = mathematical::twoPi*rndGen.sample01<scalar>();
|
||||
scalar beta = mathematical::twoPi*rndGen.globalSample01<scalar>();
|
||||
normal_ = tanVec1_*cos(beta) + tanVec2_*sin(beta);
|
||||
|
||||
switch (injectionMethod_)
|
||||
|
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -60,6 +60,13 @@ Foam::vectorField Foam::turbGen::U()
|
||||
|
||||
s = Ek(Ea, k0, mag(K))*s;
|
||||
|
||||
label ntot = 1;
|
||||
forAll(K.nn(), idim)
|
||||
{
|
||||
ntot *= K.nn()[idim];
|
||||
}
|
||||
const scalar recRootN = 1.0/sqrt(scalar(ntot));
|
||||
|
||||
complexVectorField up
|
||||
(
|
||||
fft::reverseTransform
|
||||
@ -67,7 +74,7 @@ Foam::vectorField Foam::turbGen::U()
|
||||
ComplexField(cos(constant::mathematical::twoPi*rndPhases)*s,
|
||||
sin(constant::mathematical::twoPi*rndPhases)*s),
|
||||
K.nn()
|
||||
)
|
||||
)*recRootN
|
||||
);
|
||||
|
||||
return ReImSum(up);
|
||||
|
@ -60,21 +60,26 @@ Description
|
||||
|
||||
The mass transfer correlation used is:
|
||||
|
||||
\f[ h_m = D_{ab} \frac{Sc}{L} \f]
|
||||
\f[ h_m = D_{ab} \frac{Sh}{L} \f]
|
||||
|
||||
where:
|
||||
\vartable
|
||||
D_{ab} | mass vapour difussivity
|
||||
L | characteristic length
|
||||
Sc | Schmidt number
|
||||
Sh | Sherwood number
|
||||
\endvartable
|
||||
|
||||
The Schmidt number is calculated using:
|
||||
The Sherwood number is calculated using:
|
||||
|
||||
\f{eqnarray*}{
|
||||
0.664 Re^\frac{1}{2} Sc^\frac{1}{3} & Re < 5.0E+05 \\
|
||||
0.037 Re^\frac{4}{5} Sc^\frac{1}{3} & Re > 5.0E+05
|
||||
\f}
|
||||
where:
|
||||
\vartable
|
||||
Re | Reynolds number
|
||||
Sc | Schmidt number
|
||||
\endvartable
|
||||
|
||||
NOTE:
|
||||
- The correlation used to calculate Tdew is for water vapour.
|
||||
|
@ -85,9 +85,8 @@ subModels
|
||||
|
||||
massTotal 10;
|
||||
parcelsPerInjector 20000;
|
||||
parcelsPerSecond 500;
|
||||
parcelBasisType mass;
|
||||
flowRateProfile constant 0.1;
|
||||
flowRateProfile constant 1;
|
||||
Umag constant 3.0;
|
||||
thetaInner constant 0;
|
||||
thetaOuter constant 45;
|
||||
|
Loading…
Reference in New Issue
Block a user