Merge branch 'dsmc' of ssh://graham@hunt//home/noisy3/OpenFOAM/OpenFOAM-dev into dsmc

This commit is contained in:
graham
2009-03-02 13:21:40 +00:00
15 changed files with 87 additions and 106 deletions

View File

@ -69,9 +69,6 @@ class DsmcCloud
public Cloud<ParcelType>,
public DsmcBaseCloud
{
private:
// Private data
//- Cloud type - used to set the name of the parcel properties
@ -84,9 +81,9 @@ private:
//- Dictionary of particle properties
IOdictionary particleProperties_;
//- A list of unique instances of molecule types in the simulation. The
// position of an entry in the list maps to the label identifying the
// typeId, i.e. where typeIdList_ = (N2 O2 CO2)
//- A list of unique instances of molecule types in the simulation.
// The position of an entry in the list maps to the label identifying
// the typeId, i.e. where typeIdList_ = (N2 O2 CO2)
// N2 has typeId label = 0, O2 = 1, CO2 = 2.
List<word> typeIdList_;
@ -171,6 +168,7 @@ public:
const IOdictionary& dsmcInitialiseDict
);
//- Destructor
virtual ~DsmcCloud();
@ -220,6 +218,7 @@ public:
//- Return refernce to the random object
inline Random& rndGen();
// Kinetic theory helper functions
//- Generate a random velocity sampled from the Maxwellian speed
@ -256,6 +255,7 @@ public:
//- Clear the Cloud
inline void clear();
// Sub-models
//- Return reference to binary elastic collision model
@ -274,6 +274,7 @@ public:
inline WallInteractionModel<DsmcCloud<ParcelType> >&
wallInteraction();
// Check
//- Total mass injected

View File

@ -29,6 +29,7 @@ Description
Virtual abstract base class for templated DsmcCloud
SourceFiles
DsmcBaseCloud.C
\*---------------------------------------------------------------------------*/
@ -48,7 +49,6 @@ namespace Foam
class DsmcBaseCloud
{
// Private Member Functions
//- Disallow default bitwise copy construct
@ -68,15 +68,8 @@ public:
//- Null constructor
DsmcBaseCloud();
// Destructors
//- Destructor
virtual ~DsmcBaseCloud();
// Member Functions
// Access
};

View File

@ -52,7 +52,6 @@ class dsmcCloud
:
public DsmcCloud<dsmcParcel>
{
// Private member functions
//- Disallow default bitwise copy construct
@ -86,7 +85,6 @@ public:
);
//- Destructor
~dsmcCloud();

View File

@ -72,13 +72,11 @@ class DsmcParcel
:
public Particle<ParcelType>
{
public:
//- Class to hold DSMC particle constant properties
class constantProperties
{
// Private data
//- Particle mass [kg] (constant)
@ -93,15 +91,19 @@ public:
//- Viscosity index
scalar omega_;
public:
//- Null constructor, allows List of constantProperties to be created
//- before the contents is initialised
// Constrcutors
//- Null constructor, allows List of constantProperties to be
// created before the contents is initialised
inline constantProperties();
//- Constructor from dictionary
inline constantProperties(const dictionary& dict);
// Member functions
//- Return const access to the particle density
@ -127,12 +129,12 @@ public:
:
public Particle<ParcelType>::trackData
{
// Private data
//- Reference to the cloud containing this particle
DsmcCloud<ParcelType>& cloud_;
public:
// Constructors
@ -163,6 +165,7 @@ protected:
//- Parcel type id
label typeId_;
public:
//- Runtime type information

View File

@ -86,7 +86,6 @@ public:
//- Destructor
virtual ~dsmcParcel();
};

View File

@ -53,7 +53,6 @@ namespace Foam
template<class CloudType>
class BinaryCollisionModel
{
// Private data
//- The cloud dictionary
@ -97,12 +96,10 @@ public:
// Destructor
virtual ~BinaryCollisionModel();
// Selector
//- Selector
static autoPtr<BinaryCollisionModel<CloudType> > New
(
const dictionary& dict,

View File

@ -36,10 +36,7 @@ Foam::BinaryCollisionModel<CloudType>::New
CloudType& owner
)
{
word BinaryCollisionModelType
(
dict.lookup("BinaryCollisionModel")
);
word BinaryCollisionModelType(dict.lookup("BinaryCollisionModel"));
Info<< "Selecting BinaryCollisionModel "
<< BinaryCollisionModelType

View File

@ -60,14 +60,18 @@ Foam::scalar Foam::VariableHardSphere<CloudType>::sigmaTcR
{
const CloudType& cloud(this->owner());
scalar dPQ = 0.5*
(
cloud.constProps(typeIdP).d() + cloud.constProps(typeIdQ).d()
scalar dPQ =
0.5
*(
cloud.constProps(typeIdP).d()
+ cloud.constProps(typeIdQ).d()
);
scalar omegaPQ = 0.5*
(
cloud.constProps(typeIdP).omega() + cloud.constProps(typeIdQ).omega()
scalar omegaPQ =
0.5
*(
cloud.constProps(typeIdP).omega()
+ cloud.constProps(typeIdQ).omega()
);
scalar cR = mag(UP - UQ);
@ -79,7 +83,8 @@ Foam::scalar Foam::VariableHardSphere<CloudType>::sigmaTcR
scalar mR = mP*mQ/(mP + mQ);
// calculating cross section = pi*dPQ^2, where dPQ is from Bird, eq. 4.79
scalar sigmaTPQ = mathematicalConstant::pi*dPQ*dPQ
scalar sigmaTPQ =
mathematicalConstant::pi*dPQ*dPQ
*pow(2.0*CloudType::kb*CloudType::Tref/(mR*cR*cR), omegaPQ - 0.5)
/exp(Foam::lgamma(2.5 - omegaPQ));
@ -114,7 +119,9 @@ void Foam::VariableHardSphere<CloudType>::collide
scalar phi = 2.0*mathematicalConstant::pi*rndGen.scalar01();
vector postCollisionRelU = cR*vector
vector postCollisionRelU =
cR
*vector
(
cosTheta,
sinTheta*cos(phi),

View File

@ -47,11 +47,6 @@ class VariableHardSphere
:
public BinaryCollisionModel<CloudType>
{
// Private data
// const scalar something_;
public:
//- Runtime type information
@ -69,8 +64,7 @@ public:
// Destructor
~VariableHardSphere();
virtual ~VariableHardSphere();
// Member Functions

View File

@ -24,8 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "MaxwellianThermal.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -108,8 +106,13 @@ void Foam::MaxwellianThermal<CloudType>::correct
scalar C = sqrt(CloudType::kb*T_/mass);
U = C*(rndGen.GaussNormal()*tw1 + rndGen.GaussNormal()*tw2
- sqrt(-2.0*log(max(1 - rndGen.scalar01(),VSMALL)))*nw);
U =
C
*(
rndGen.GaussNormal()*tw1
+ rndGen.GaussNormal()*tw2
- sqrt(-2.0*log(max(1 - rndGen.scalar01(),VSMALL)))*nw
);
}

View File

@ -49,7 +49,6 @@ class MaxwellianThermal
:
public WallInteractionModel<CloudType>
{
// Private data
//- Temperature
@ -73,8 +72,7 @@ public:
// Destructor
~MaxwellianThermal();
virtual ~MaxwellianThermal();
// Member Functions

View File

@ -48,7 +48,6 @@ class SpecularReflection
:
public WallInteractionModel<CloudType>
{
public:
//- Runtime type information
@ -66,8 +65,7 @@ public:
// Destructor
~SpecularReflection();
virtual ~SpecularReflection();
// Member Functions

View File

@ -36,10 +36,7 @@ Foam::WallInteractionModel<CloudType>::New
CloudType& owner
)
{
word WallInteractionModelType
(
dict.lookup("WallInteractionModel")
);
word WallInteractionModelType(dict.lookup("WallInteractionModel"));
Info<< "Selecting WallInteractionModel " << WallInteractionModelType
<< endl;

View File

@ -25,7 +25,6 @@ License
Class
Foam::WallInteractionModel
Description
Templated wall interaction model class
@ -54,7 +53,6 @@ namespace Foam
template<class CloudType>
class WallInteractionModel
{
// Private data
//- The cloud dictionary
@ -98,12 +96,10 @@ public:
// Destructor
virtual ~WallInteractionModel();
// Selector
//- Selector
static autoPtr<WallInteractionModel<CloudType> > New
(
const dictionary& dict,