diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C index 7837396e9d8f6f63ec834203f8067a5c800c9daf..5f00f4ca93594989f248f0bfaa9691df0ceb0dd3 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C @@ -68,16 +68,18 @@ Foam::scalar Foam::LarsenBorgnakkeVariableHardSphere<CloudType>::energyRatio } else { - P = pow - ( - (ChiAMinusOne + ChiBMinusOne)*energyRatio/ChiAMinusOne, - ChiAMinusOne - ) - *pow - ( - (ChiAMinusOne + ChiBMinusOne)*(1 - energyRatio)/ChiBMinusOne, - ChiBMinusOne - ); + P = + pow + ( + (ChiAMinusOne + ChiBMinusOne)*energyRatio/ChiAMinusOne, + ChiAMinusOne + ) + *pow + ( + (ChiAMinusOne + ChiBMinusOne)*(1 - energyRatio) + /ChiBMinusOne, + ChiBMinusOne + ); } } diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C b/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C index ba53abcc8618ecb6fc0a07aafa942cc4dd3be4f1..3776848d8bce37237f069d4b7fb5f08bf83f68f8 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C @@ -35,8 +35,7 @@ Foam::MaxwellianThermal<CloudType>::MaxwellianThermal CloudType& cloud ) : - WallInteractionModel<CloudType>(dict, cloud, typeName), - T_(dimensionedScalar(this->coeffDict().lookup("T")).value()) + WallInteractionModel<CloudType>(dict, cloud, typeName) {} @@ -65,7 +64,11 @@ void Foam::MaxwellianThermal<CloudType>::correct scalar mass ) { - vector nw = wpp.faceAreas()[wpp.whichFace(faceId)]; + label wppIndex = wpp.index(); + + label wppLocalFace = wpp.whichFace(faceId); + + vector nw = wpp.faceAreas()[wppLocalFace]; // Normal unit vector nw /= mag(nw); @@ -104,7 +107,9 @@ void Foam::MaxwellianThermal<CloudType>::correct // Other tangential unit vector vector tw2 = nw ^ tw1; - scalar C = sqrt(CloudType::kb*T_/mass); + scalar T = cloud.T().boundaryField()[wppIndex][wppLocalFace]; + + scalar C = sqrt(CloudType::kb*T/mass); U = C @@ -113,6 +118,8 @@ void Foam::MaxwellianThermal<CloudType>::correct + rndGen.GaussNormal()*tw2 - sqrt(-2.0*log(max(1 - rndGen.scalar01(),VSMALL)))*nw ); + + U += cloud.U().boundaryField()[wppIndex][wppLocalFace]; } diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.H b/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.H index 78ee59e1bfc5a922d87ab8d21dd8d440bd1aa9f1..38ce78ed7e6837a634b408d1e2b20d893aa11e46 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.H +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.H @@ -49,11 +49,6 @@ class MaxwellianThermal : public WallInteractionModel<CloudType> { - // Private data - - //- Temperature - const scalar T_; - public: