Adding normal velocity weighted measurements to face values of linearKE,

internalE, rhoN and iDof fields to measure surface temperatures.
This commit is contained in:
graham
2009-07-21 15:10:23 +01:00
parent 85d7852fc3
commit c097265645
4 changed files with 80 additions and 18 deletions

View File

@ -511,25 +511,18 @@ template<class ParcelType>
void Foam::DsmcCloud<ParcelType>::calculateFields()
{
scalarField& rhoN = rhoN_.internalField();
rhoN = VSMALL;
scalarField& rhoM = rhoM_.internalField();
rhoM = VSMALL;
scalarField& dsmcRhoN = dsmcRhoN_.internalField();
dsmcRhoN = 0.0;
scalarField& linearKE = linearKE_.internalField();
linearKE = 0.0;
scalarField& internalE = internalE_.internalField();
internalE = 0.0;
scalarField& iDof = iDof_.internalField();
iDof = VSMALL;
vectorField& momentum = momentum_.internalField();
momentum = vector::zero;
forAllConstIter(typename DsmcCloud<ParcelType>, *this, iter)
{

View File

@ -287,9 +287,24 @@ public:
//- Return non-const force density at boundary field reference
inline volVectorField::GeometricBoundaryField& fDBF();
//- Return non-const number density boundary field reference
inline volScalarField::GeometricBoundaryField& rhoNBF();
//- Return non-const mass density boundary field reference
inline volScalarField::GeometricBoundaryField& rhoMBF();
//- Return non-const linear kinetic energy density boundary
// field reference
inline volScalarField::GeometricBoundaryField& linearKEBF();
//- Return non-const internal energy density boundary field
// reference
inline volScalarField::GeometricBoundaryField& internalEBF();
//- Return non-const internal degree of freedom density boundary
// field reference
inline volScalarField::GeometricBoundaryField& iDofBF();
//- Return non-const momentum density boundary field reference
inline volVectorField::GeometricBoundaryField& momentumBF();

View File

@ -151,10 +151,10 @@ Foam::DsmcCloud<ParcelType>::fDBF()
template<class ParcelType>
inline Foam::volVectorField::GeometricBoundaryField&
Foam::DsmcCloud<ParcelType>::momentumBF()
inline Foam::volScalarField::GeometricBoundaryField&
Foam::DsmcCloud<ParcelType>::rhoNBF()
{
return momentum_.boundaryField();
return rhoN_.boundaryField();
}
@ -166,6 +166,38 @@ Foam::DsmcCloud<ParcelType>::rhoMBF()
}
template<class ParcelType>
inline Foam::volScalarField::GeometricBoundaryField&
Foam::DsmcCloud<ParcelType>::linearKEBF()
{
return linearKE_.boundaryField();
}
template<class ParcelType>
inline Foam::volScalarField::GeometricBoundaryField&
Foam::DsmcCloud<ParcelType>::internalEBF()
{
return internalE_.boundaryField();
}
template<class ParcelType>
inline Foam::volScalarField::GeometricBoundaryField&
Foam::DsmcCloud<ParcelType>::iDofBF()
{
return iDof_.boundaryField();
}
template<class ParcelType>
inline Foam::volVectorField::GeometricBoundaryField&
Foam::DsmcCloud<ParcelType>::momentumBF()
{
return momentum_.boundaryField();
}
template<class ParcelType>
inline const Foam::volScalarField&
Foam::DsmcCloud<ParcelType>::boundaryT() const

View File

@ -130,13 +130,24 @@ void Foam::DsmcParcel<ParcelType>::hitWallPatch
nw /= mag(nw);
scalar U_dot_nw = U_ & nw;
vector Ut = U_ - U_dot_nw*nw;
td.cloud().momentumBF()[wppIndex][wppLocalFace] +=
m*Ut/max(mag(U_dot_nw)*fA, VSMALL);
scalar invMagUnfA = 1/max(mag(U_dot_nw)*fA, VSMALL);
td.cloud().rhoMBF()[wppIndex][wppLocalFace] +=
m/max(mag(U_dot_nw)*fA, VSMALL);
td.cloud().rhoNBF()[wppIndex][wppLocalFace] += invMagUnfA;
td.cloud().rhoMBF()[wppIndex][wppLocalFace] += m*invMagUnfA;
td.cloud().linearKEBF()[wppIndex][wppLocalFace] +=
0.5*m*(U_ & U_)*invMagUnfA;
td.cloud().internalEBF()[wppIndex][wppLocalFace] += Ei_*invMagUnfA;
td.cloud().iDofBF()[wppIndex][wppLocalFace] +=
constProps.internalDegreesOfFreedom()*invMagUnfA;
td.cloud().momentumBF()[wppIndex][wppLocalFace] += m*Ut*invMagUnfA;
// pre-interaction energy
scalar preIE = 0.5*m*(U_ & U_) + Ei_;
@ -154,13 +165,24 @@ void Foam::DsmcParcel<ParcelType>::hitWallPatch
);
U_dot_nw = U_ & nw;
Ut = U_ - U_dot_nw*nw;
td.cloud().momentumBF()[wppIndex][wppLocalFace] +=
m*Ut/max(mag(U_dot_nw)*fA, VSMALL);
invMagUnfA = 1/max(mag(U_dot_nw)*fA, VSMALL);
td.cloud().rhoMBF()[wppIndex][wppLocalFace] +=
m/max(mag(U_dot_nw)*fA, VSMALL);
td.cloud().rhoNBF()[wppIndex][wppLocalFace] += invMagUnfA;
td.cloud().rhoMBF()[wppIndex][wppLocalFace] += m*invMagUnfA;
td.cloud().linearKEBF()[wppIndex][wppLocalFace] +=
0.5*m*(U_ & U_)*invMagUnfA;
td.cloud().internalEBF()[wppIndex][wppLocalFace] += Ei_*invMagUnfA;
td.cloud().iDofBF()[wppIndex][wppLocalFace] +=
constProps.internalDegreesOfFreedom()*invMagUnfA;
td.cloud().momentumBF()[wppIndex][wppLocalFace] += m*Ut*invMagUnfA;
// post-interaction energy
scalar postIE = 0.5*m*(U_ & U_) + Ei_;