mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -150,6 +150,7 @@ $(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityK
|
|||||||
$(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C
|
$(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C
|
$(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
|
$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
|
||||||
|
$(derivedFvPatchFields)/swirlMassFlowRateInletVelocity/swirlMassFlowRateInletVelocityFvPatchVectorField.C
|
||||||
|
|
||||||
fvsPatchFields = fields/fvsPatchFields
|
fvsPatchFields = fields/fvsPatchFields
|
||||||
$(fvsPatchFields)/fvsPatchField/fvsPatchFields.C
|
$(fvsPatchFields)/fvsPatchField/fvsPatchFields.C
|
||||||
|
|||||||
@ -0,0 +1,200 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2006-2009 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "swirlMassFlowRateInletVelocityFvPatchVectorField.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "fvPatchFieldMapper.H"
|
||||||
|
#include "surfaceFields.H"
|
||||||
|
#include "mathematicalConstants.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<vector, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchField<vector>(p, iF),
|
||||||
|
flowRate_(0),
|
||||||
|
phiName_("phi"),
|
||||||
|
rhoName_("rho"),
|
||||||
|
rpm_(0)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const swirlMassFlowRateInletVelocityFvPatchVectorField& ptf,
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<vector, volMesh>& iF,
|
||||||
|
const fvPatchFieldMapper& mapper
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
|
||||||
|
flowRate_(ptf.flowRate_),
|
||||||
|
phiName_(ptf.phiName_),
|
||||||
|
rhoName_(ptf.rhoName_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<vector, volMesh>& iF,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchField<vector>(p, iF, dict),
|
||||||
|
flowRate_(readScalar(dict.lookup("flowRate"))),
|
||||||
|
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||||
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||||
|
rpm_(readScalar(dict.lookup("rpm")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const swirlMassFlowRateInletVelocityFvPatchVectorField& ptf
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchField<vector>(ptf),
|
||||||
|
flowRate_(ptf.flowRate_),
|
||||||
|
phiName_(ptf.phiName_),
|
||||||
|
rhoName_(ptf.rhoName_),
|
||||||
|
rpm_(ptf.rpm_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField::
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const swirlMassFlowRateInletVelocityFvPatchVectorField& ptf,
|
||||||
|
const DimensionedField<vector, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchField<vector>(ptf, iF),
|
||||||
|
flowRate_(ptf.flowRate_),
|
||||||
|
phiName_(ptf.phiName_),
|
||||||
|
rhoName_(ptf.rhoName_),
|
||||||
|
rpm_(ptf.rpm_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::swirlMassFlowRateInletVelocityFvPatchVectorField::updateCoeffs()
|
||||||
|
{
|
||||||
|
if (updated())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
scalar totArea = gSum(patch().magSf());
|
||||||
|
// a simpler way of doing this would be nice
|
||||||
|
scalar avgU = -flowRate_/totArea;
|
||||||
|
|
||||||
|
vector center = gSum(patch().Cf()*patch().magSf())/totArea;
|
||||||
|
vector normal = gSum(patch().nf()*patch().magSf())/totArea;
|
||||||
|
|
||||||
|
vectorField tangVelo =
|
||||||
|
(rpm_*constant::mathematical::pi/30.0)
|
||||||
|
*(patch().Cf() - center) ^ normal;
|
||||||
|
|
||||||
|
vectorField n = patch().nf();
|
||||||
|
|
||||||
|
const surfaceScalarField& phi =
|
||||||
|
db().lookupObject<surfaceScalarField>(phiName_);
|
||||||
|
|
||||||
|
if (phi.dimensions() == dimVelocity*dimArea)
|
||||||
|
{
|
||||||
|
// volumetric flow-rate
|
||||||
|
operator==(tangVelo + n*avgU);
|
||||||
|
}
|
||||||
|
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
||||||
|
{
|
||||||
|
const fvPatchField<scalar>& rhop =
|
||||||
|
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||||
|
|
||||||
|
// mass flow-rate
|
||||||
|
operator==(tangVelo + n*avgU/rhop);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"swirlMassFlowRateInletVelocityFvPatchVectorField::updateCoeffs()"
|
||||||
|
) << "dimensions of " << phiName_ << " are incorrect" << nl
|
||||||
|
<< " on patch " << this->patch().name()
|
||||||
|
<< " of field " << this->dimensionedInternalField().name()
|
||||||
|
<< " in file " << this->dimensionedInternalField().objectPath()
|
||||||
|
<< nl << exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
fixedValueFvPatchField<vector>::updateCoeffs();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::swirlMassFlowRateInletVelocityFvPatchVectorField::write(Ostream& os) const
|
||||||
|
{
|
||||||
|
fvPatchField<vector>::write(os);
|
||||||
|
os.writeKeyword("flowRate") << flowRate_ << token::END_STATEMENT << nl;
|
||||||
|
if (phiName_ != "phi")
|
||||||
|
{
|
||||||
|
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
if (rhoName_ != "rho")
|
||||||
|
{
|
||||||
|
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
os.writeKeyword("rpm") << rpm_ << token::END_STATEMENT << nl;
|
||||||
|
writeEntry("value", os);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
makePatchTypeField
|
||||||
|
(
|
||||||
|
fvPatchVectorField,
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,191 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
|
||||||
|
Description
|
||||||
|
Describes a volumetric/mass flow normal vector boundary condition by its
|
||||||
|
magnitude as an integral over its area with a swirl component determined
|
||||||
|
by the RPM
|
||||||
|
|
||||||
|
The basis of the patch (volumetric or mass) is determined by the
|
||||||
|
dimensions of the flux, phi.
|
||||||
|
The current density is used to correct the velocity when applying the
|
||||||
|
mass basis.
|
||||||
|
|
||||||
|
Example of the boundary condition specification:
|
||||||
|
@verbatim
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type swirlMassFlowRateInletVelocity;
|
||||||
|
flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s]
|
||||||
|
rpm 100;
|
||||||
|
}
|
||||||
|
@endverbatim
|
||||||
|
|
||||||
|
Note
|
||||||
|
- The value is positive inwards
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef swirlMassFlowRateInletVelocityFvPatchVectorField_H
|
||||||
|
#define swirlMassFlowRateInletVelocityFvPatchVectorField_H
|
||||||
|
|
||||||
|
#include "fixedValueFvPatchFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class swirlMassFlowRateInletVelocityFvPatchVectorField Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
:
|
||||||
|
public fixedValueFvPatchVectorField
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Inlet integral flow rate
|
||||||
|
scalar flowRate_;
|
||||||
|
|
||||||
|
//- Name of the flux transporting the field
|
||||||
|
word phiName_;
|
||||||
|
|
||||||
|
//- Name of the density field used to normalize the mass flux
|
||||||
|
word rhoName_;
|
||||||
|
|
||||||
|
//- RPM
|
||||||
|
scalar rpm_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("swirlMassFlowRateInletVelocity");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from patch and internal field
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<vector, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from patch, internal field and dictionary
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<vector, volMesh>&,
|
||||||
|
const dictionary&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct by mapping given
|
||||||
|
// flowRateInletVelocityFvPatchVectorField
|
||||||
|
// onto a new patch
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const swirlMassFlowRateInletVelocityFvPatchVectorField&,
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<vector, volMesh>&,
|
||||||
|
const fvPatchFieldMapper&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct as copy
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const swirlMassFlowRateInletVelocityFvPatchVectorField&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual tmp<fvPatchVectorField> clone() const
|
||||||
|
{
|
||||||
|
return tmp<fvPatchVectorField>
|
||||||
|
(
|
||||||
|
new swirlMassFlowRateInletVelocityFvPatchVectorField(*this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Construct as copy setting internal field reference
|
||||||
|
swirlMassFlowRateInletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const swirlMassFlowRateInletVelocityFvPatchVectorField&,
|
||||||
|
const DimensionedField<vector, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone setting internal field reference
|
||||||
|
virtual tmp<fvPatchVectorField> clone
|
||||||
|
(
|
||||||
|
const DimensionedField<vector, volMesh>& iF
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<fvPatchVectorField>
|
||||||
|
(
|
||||||
|
new swirlMassFlowRateInletVelocityFvPatchVectorField(*this, iF)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Return the flux
|
||||||
|
scalar flowRate() const
|
||||||
|
{
|
||||||
|
return flowRate_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return reference to the flux to allow adjustment
|
||||||
|
scalar& flowRate()
|
||||||
|
{
|
||||||
|
return flowRate_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Update the coefficients associated with the patch field
|
||||||
|
virtual void updateCoeffs();
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -346,7 +346,7 @@ bool Foam::KinematicParcel<ParcelType>::hitPatch
|
|||||||
{
|
{
|
||||||
ParcelType& p = static_cast<ParcelType&>(*this);
|
ParcelType& p = static_cast<ParcelType&>(*this);
|
||||||
|
|
||||||
// Invoke poost-processing mdoel
|
// Invoke post-processing model
|
||||||
td.cloud().postProcessing().postPatch(p, patchI);
|
td.cloud().postProcessing().postPatch(p, patchI);
|
||||||
|
|
||||||
// Invoke surface film model
|
// Invoke surface film model
|
||||||
|
|||||||
@ -212,7 +212,12 @@ Foam::scalar Foam::InjectionModel<CloudType>::setNumberOfParticles
|
|||||||
}
|
}
|
||||||
case pbNumber:
|
case pbNumber:
|
||||||
{
|
{
|
||||||
nP = massTotal_/(rho*volumeTotal_*parcels);
|
nP = massTotal_/(rho*volumeTotal_);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case pbFixed:
|
||||||
|
{
|
||||||
|
nP = nParticlesFixed_;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -285,6 +290,7 @@ Foam::InjectionModel<CloudType>::InjectionModel(CloudType& owner)
|
|||||||
nInjections_(0),
|
nInjections_(0),
|
||||||
parcelsAddedTotal_(0),
|
parcelsAddedTotal_(0),
|
||||||
parcelBasis_(pbNumber),
|
parcelBasis_(pbNumber),
|
||||||
|
nParticlesFixed_(0.0),
|
||||||
time0_(0.0),
|
time0_(0.0),
|
||||||
timeStep0_(0.0)
|
timeStep0_(0.0)
|
||||||
{
|
{
|
||||||
@ -310,6 +316,7 @@ Foam::InjectionModel<CloudType>::InjectionModel
|
|||||||
nInjections_(0),
|
nInjections_(0),
|
||||||
parcelsAddedTotal_(0),
|
parcelsAddedTotal_(0),
|
||||||
parcelBasis_(pbNumber),
|
parcelBasis_(pbNumber),
|
||||||
|
nParticlesFixed_(0.0),
|
||||||
time0_(owner.db().time().value()),
|
time0_(owner.db().time().value()),
|
||||||
timeStep0_(0.0)
|
timeStep0_(0.0)
|
||||||
{
|
{
|
||||||
@ -320,6 +327,7 @@ Foam::InjectionModel<CloudType>::InjectionModel
|
|||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
const word parcelBasisType = coeffDict_.lookup("parcelBasisType");
|
const word parcelBasisType = coeffDict_.lookup("parcelBasisType");
|
||||||
|
|
||||||
if (parcelBasisType == "mass")
|
if (parcelBasisType == "mass")
|
||||||
{
|
{
|
||||||
parcelBasis_ = pbMass;
|
parcelBasis_ = pbMass;
|
||||||
@ -328,6 +336,16 @@ Foam::InjectionModel<CloudType>::InjectionModel
|
|||||||
{
|
{
|
||||||
parcelBasis_ = pbNumber;
|
parcelBasis_ = pbNumber;
|
||||||
}
|
}
|
||||||
|
else if (parcelBasisType == "fixed")
|
||||||
|
{
|
||||||
|
parcelBasis_ = pbFixed;
|
||||||
|
|
||||||
|
Info<< " Choosing nParticles to be a fixed value, massTotal "
|
||||||
|
<< "variable now does not determine anything."
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
nParticlesFixed_ = readScalar(coeffDict_.lookup("nParticles"));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
@ -338,7 +356,7 @@ Foam::InjectionModel<CloudType>::InjectionModel
|
|||||||
"CloudType&, "
|
"CloudType&, "
|
||||||
"const word&"
|
"const word&"
|
||||||
")"
|
")"
|
||||||
)<< "parcelBasisType must be either 'number' or 'mass'" << nl
|
)<< "parcelBasisType must be either 'number', 'mass' or 'fixed'" << nl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -73,7 +73,8 @@ public:
|
|||||||
enum parcelBasis
|
enum parcelBasis
|
||||||
{
|
{
|
||||||
pbNumber,
|
pbNumber,
|
||||||
pbMass
|
pbMass,
|
||||||
|
pbFixed
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -137,6 +138,10 @@ protected:
|
|||||||
//- Parcel basis enumeration
|
//- Parcel basis enumeration
|
||||||
parcelBasis parcelBasis_;
|
parcelBasis parcelBasis_;
|
||||||
|
|
||||||
|
//- nParticles to assign to parcels when the 'fixed' basis
|
||||||
|
// is selected
|
||||||
|
scalar nParticlesFixed_;
|
||||||
|
|
||||||
//- Continuous phase time at start of injection time step [s]
|
//- Continuous phase time at start of injection time step [s]
|
||||||
scalar time0_;
|
scalar time0_;
|
||||||
|
|
||||||
|
|||||||
@ -76,9 +76,6 @@ class ManualInjection
|
|||||||
//- Parcel size PDF model
|
//- Parcel size PDF model
|
||||||
const autoPtr<pdfs::pdf> parcelPDF_;
|
const autoPtr<pdfs::pdf> parcelPDF_;
|
||||||
|
|
||||||
//- Number of particles represented by each parcel
|
|
||||||
scalar nParticlesPerParcel_;
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,7 @@ $(kqRWallFunctions)/kqRWallFunction/kqRWallFunctionFvPatchFields.C
|
|||||||
derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C
|
derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C
|
||||||
derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
|
derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
|
||||||
derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
|
derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
|
||||||
|
derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C
|
||||||
|
|
||||||
backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C
|
backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,164 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "fixedShearStressFvPatchVectorField.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "fvPatchFieldMapper.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "RASModel.H"
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace incompressible
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
fixedShearStressFvPatchVectorField::
|
||||||
|
fixedShearStressFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<vector, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchVectorField(p, iF),
|
||||||
|
tau0_(vector::zero)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
fixedShearStressFvPatchVectorField::
|
||||||
|
fixedShearStressFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<vector, volMesh>& iF,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchVectorField(p, iF),
|
||||||
|
tau0_(dict.lookupOrDefault<vector>("tau", vector::zero))
|
||||||
|
{
|
||||||
|
fvPatchField<vector>::operator=(patchInternalField());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fixedShearStressFvPatchVectorField::
|
||||||
|
fixedShearStressFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fixedShearStressFvPatchVectorField& ptf,
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<vector, volMesh>& iF,
|
||||||
|
const fvPatchFieldMapper& mapper
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchVectorField(ptf, p, iF, mapper),
|
||||||
|
tau0_(ptf.tau0_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
fixedShearStressFvPatchVectorField::
|
||||||
|
fixedShearStressFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fixedShearStressFvPatchVectorField& ptf
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchVectorField(ptf),
|
||||||
|
tau0_(ptf.tau0_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
fixedShearStressFvPatchVectorField::
|
||||||
|
fixedShearStressFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fixedShearStressFvPatchVectorField& ptf,
|
||||||
|
const DimensionedField<vector, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchVectorField(ptf, iF),
|
||||||
|
tau0_(ptf.tau0_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void fixedShearStressFvPatchVectorField::updateCoeffs()
|
||||||
|
{
|
||||||
|
if (updated())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const label patchI = patch().index();
|
||||||
|
|
||||||
|
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
||||||
|
|
||||||
|
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
||||||
|
|
||||||
|
const vectorField Ui = Uw.patchInternalField();
|
||||||
|
|
||||||
|
vector tauHat = tau0_/mag(tau0_);
|
||||||
|
|
||||||
|
const scalarField& ry = patch().deltaCoeffs();
|
||||||
|
|
||||||
|
scalarField nuEffw = rasModel.nuEff()().boundaryField()[patchI];
|
||||||
|
|
||||||
|
vectorField UwUpdated =
|
||||||
|
tauHat*(tauHat & (tau0_*(1.0/(ry*nuEffw)) + Ui));
|
||||||
|
|
||||||
|
operator==(UwUpdated);
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
vectorField nHat = this->patch().nf();
|
||||||
|
volSymmTensorField Reff = rasModel.devReff();
|
||||||
|
Info << "tau : " << (nHat & Reff.boundaryField()[patchI])() << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
fixedValueFvPatchVectorField::updateCoeffs();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void fixedShearStressFvPatchVectorField::write(Ostream& os) const
|
||||||
|
{
|
||||||
|
fixedValueFvPatchVectorField::write(os);
|
||||||
|
os.writeKeyword("tau") << tau0_ << token::END_STATEMENT << nl;
|
||||||
|
writeEntry("value", os);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
makePatchTypeField
|
||||||
|
(
|
||||||
|
fvPatchVectorField,
|
||||||
|
fixedShearStressFvPatchVectorField
|
||||||
|
);
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace incompressible
|
||||||
|
} // End namespace Foam
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,147 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::fixedShearStressFvPatchVectorField
|
||||||
|
|
||||||
|
Description
|
||||||
|
Set a constant shear stress as tau0 = -nuEff dU/dn.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
fixedShearStressFvPatchVectorField.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef fixedShearStressFvPatchVectorField_H
|
||||||
|
#define fixedShearStressFvPatchVectorField_H
|
||||||
|
|
||||||
|
#include "fvPatchFields.H"
|
||||||
|
#include "fixedValueFvPatchFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace incompressible
|
||||||
|
{
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class fixedShearStressFvPatchVectorField Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class fixedShearStressFvPatchVectorField
|
||||||
|
:
|
||||||
|
public fixedValueFvPatchVectorField
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Constant shear stress
|
||||||
|
vector tau0_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("fixedShearStress");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from patch and internal field
|
||||||
|
fixedShearStressFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<vector, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from patch, internal field and dictionary
|
||||||
|
fixedShearStressFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<vector, volMesh>&,
|
||||||
|
const dictionary&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct by mapping given
|
||||||
|
fixedShearStressFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fixedShearStressFvPatchVectorField&,
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<vector, volMesh>&,
|
||||||
|
const fvPatchFieldMapper&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct as copy
|
||||||
|
fixedShearStressFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fixedShearStressFvPatchVectorField&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual tmp<fvPatchVectorField> clone() const
|
||||||
|
{
|
||||||
|
return tmp<fvPatchVectorField>
|
||||||
|
(
|
||||||
|
new fixedShearStressFvPatchVectorField(*this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Construct as copy setting internal field reference
|
||||||
|
fixedShearStressFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fixedShearStressFvPatchVectorField&,
|
||||||
|
const DimensionedField<vector, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone setting internal field reference
|
||||||
|
virtual tmp<fvPatchVectorField> clone
|
||||||
|
(
|
||||||
|
const DimensionedField<vector, volMesh>& iF
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<fvPatchVectorField>
|
||||||
|
(
|
||||||
|
new fixedShearStressFvPatchVectorField(*this, iF)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
//- Update the coefficients associated with the patch field
|
||||||
|
virtual void updateCoeffs();
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace incompressible
|
||||||
|
} // End namespace Foam
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
Reference in New Issue
Block a user