| 63 | |
| 64 | |
| 65 | void Foam::functionObjects::yPlus::calcYPlus |
| 66 | ( |
| 67 | const turbulenceModel& turbModel, |
| 68 | volScalarField& yPlus |
| 69 | ) |
| 70 | { |
| 71 | volScalarField::Boundary d = nearWallDist(mesh_).y(); |
| 72 | |
| 73 | const volScalarField::Boundary nutBf = |
| 74 | turbModel.nut()().boundaryField(); |
| 75 | |
| 76 | const volScalarField::Boundary nuEffBf = |
| 77 | turbModel.nuEff()().boundaryField(); |
| 78 | |
| 79 | const volScalarField::Boundary nuBf = |
| 80 | turbModel.nu()().boundaryField(); |
| 81 | |
| 82 | const fvPatchList& patches = mesh_.boundary(); |
| 83 | |
| 84 | volScalarField::Boundary& yPlusBf = yPlus.boundaryFieldRef(); |
| 85 | |
| 86 | forAll(patches, patchi) |
| 87 | { |
| 88 | const fvPatch& patch = patches[patchi]; |
| 89 | |
| 90 | if (isA<nutWallFunctionFvPatchScalarField>(nutBf[patchi])) |
| 91 | { |
| 92 | const nutWallFunctionFvPatchScalarField& nutPf = |
| 93 | dynamic_cast<const nutWallFunctionFvPatchScalarField&> |
| 94 | ( |
| 95 | nutBf[patchi] |
| 96 | ); |
| 97 | |
| 98 | yPlusBf[patchi] = nutPf.yPlus(); |
| 99 | } |
| 100 | else if (isA<wallFvPatch>(patch)) |
| 101 | { |
| 102 | yPlusBf[patchi] = |
| 103 | d[patchi] |
| 104 | *sqrt |
| 105 | ( |
| 106 | nuEffBf[patchi] |
| 107 | *mag(turbModel.U().boundaryField()[patchi].snGrad()) |
| 108 | )/nuBf[patchi]; |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | |
| 114 | // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // |
no test coverage detected