filmSurfaceVelocityFvPatchVectorField: Added neighbour density mapping

This commit is contained in:
Henry Weller
2023-05-05 22:14:13 +01:00
parent 474e9c0c55
commit efe8310371

View File

@ -140,31 +140,29 @@ void Foam::filmSurfaceVelocityFvPatchVectorField::updateCoeffs()
const compressibleMomentumTransportModel& transportModel = const compressibleMomentumTransportModel& transportModel =
db().lookupType<compressibleMomentumTransportModel>(); db().lookupType<compressibleMomentumTransportModel>();
// Patch density
const scalarField& rhop
(
transportModel.rho().boundaryField()[patch().index()]
);
// Patch laminar dynamic viscosity divided by delta
const tmp<scalarField> muEffByDelta
(
rhop*transportModel.nuEff(patch().index())
*patch().deltaCoeffs()
);
// Lookup the neighbour momentum transport model // Lookup the neighbour momentum transport model
const compressibleMomentumTransportModel& transportModelNbr = const compressibleMomentumTransportModel& transportModelNbr =
mpp.nbrMesh().lookupType<compressibleMomentumTransportModel>(); mpp.nbrMesh().lookupType<compressibleMomentumTransportModel>();
// Neighbour patch density // Patch laminar dynamic viscosity divided by delta
const scalarField& rhopNbr const tmp<scalarField> muEffByDelta
( (
transportModelNbr.rho().boundaryField()[patchiNbr] transportModel.rho().boundaryField()[patch().index()]
*transportModel.nuEff(patch().index())
*patch().deltaCoeffs()
); );
if (Cs_ > 0) if (Cs_ > 0)
{ {
// Get the neighbour patch density
const tmp<scalarField> rhopNbr
(
mpp.fromNeighbour
(
transportModelNbr.rho().boundaryField()[patchiNbr]
)
);
// Calculate the drag coefficient from the drag constant // Calculate the drag coefficient from the drag constant
// and the magnitude of the velocity difference // and the magnitude of the velocity difference
const scalarField Ds(Cs_*rhopNbr*mag(refValue() - *this)); const scalarField Ds(Cs_*rhopNbr*mag(refValue() - *this));
@ -180,7 +178,8 @@ void Foam::filmSurfaceVelocityFvPatchVectorField::updateCoeffs()
( (
mpp.fromNeighbour mpp.fromNeighbour
( (
rhopNbr*transportModelNbr.nuEff(patchiNbr) transportModelNbr.rho().boundaryField()[patchiNbr]
*transportModelNbr.nuEff(patchiNbr)
*patchNbr.deltaCoeffs() *patchNbr.deltaCoeffs()
) )
); );