diff --git a/src/waves/fvModels/forcing/forcing.C b/src/waves/fvModels/forcing/forcing.C index a51c5bc5af..895fd55258 100644 --- a/src/waves/fvModels/forcing/forcing.C +++ b/src/waves/fvModels/forcing/forcing.C @@ -50,6 +50,14 @@ void Foam::fv::forcing::readCoeffs() coeffs().lookup(lambda_.name()) ); + lambdaBoundary_ = + dimensionedScalar + ( + lambdaBoundary_.name(), + lambdaBoundary_.dimensions(), + coeffs().lookupOrDefault(lambdaBoundary_.name(), 0) + ); + const bool foundScale = coeffs().found("scale"); const bool foundOgn = coeffs().found("origin"); const bool foundDir = coeffs().found("direction"); @@ -157,6 +165,22 @@ Foam::tmp Foam::fv::forcing::forceCoeff volScalarField::Internal::New(typedName("forceCoeff"), lambda_*scale) ); + // Damp the cells adjacent to the boundary with lambdaBoundary if specified + if (lambdaBoundary_.value() > 0) + { + const fvBoundaryMesh& bm = mesh().boundary(); + + forAll(bm, patchi) + { + if (!bm[patchi].coupled()) + { + UIndirectList(tforceCoeff.ref(), bm[patchi].faceCells()) + = lambdaBoundary_.value() + *Field(scale, bm[patchi].faceCells()); + } + } + } + // Write out the force coefficient for debugging if (debug && mesh().time().writeTime()) { @@ -185,6 +209,7 @@ Foam::fv::forcing::forcing : fvModel(name, modelType, mesh, dict), lambda_("lambda", dimless/dimTime, NaN), + lambdaBoundary_("lambdaBoundary", dimless/dimTime, 0), scale_(nullptr), origins_(), directions_() diff --git a/src/waves/fvModels/forcing/forcing.H b/src/waves/fvModels/forcing/forcing.H index fb918a8d30..989d18de82 100644 --- a/src/waves/fvModels/forcing/forcing.H +++ b/src/waves/fvModels/forcing/forcing.H @@ -65,6 +65,9 @@ protected: //- Damping coefficient [1/s] dimensionedScalar lambda_; + //- Optional boundary damping coefficient [1/s] + dimensionedScalar lambdaBoundary_; + //- The scaling function autoPtr> scale_; diff --git a/src/waves/fvModels/waveForcing/waveForcing.H b/src/waves/fvModels/waveForcing/waveForcing.H index 12c4e63477..304dcce003 100644 --- a/src/waves/fvModels/waveForcing/waveForcing.H +++ b/src/waves/fvModels/waveForcing/waveForcing.H @@ -63,6 +63,10 @@ Usage } lambda 0.5; // Forcing coefficient + + // lambda 2; // Optional boundary forcing coefficient + // Useful when wave BCs are specified + // without mean flow } \endverbatim diff --git a/tutorials/incompressibleVoF/floatingObjectWaves/constant/fvModels b/tutorials/incompressibleVoF/floatingObjectWaves/constant/fvModels index 24ad7bfbe6..870980f48d 100644 --- a/tutorials/incompressibleVoF/floatingObjectWaves/constant/fvModels +++ b/tutorials/incompressibleVoF/floatingObjectWaves/constant/fvModels @@ -45,7 +45,8 @@ forcing duration 0.5; } - lambda 25; + lambda 5; + lambdaBoundary 25; } diff --git a/tutorials/incompressibleVoF/floatingObjectWaves/system/controlDict b/tutorials/incompressibleVoF/floatingObjectWaves/system/controlDict index edf8b160fa..c3dac56239 100644 --- a/tutorials/incompressibleVoF/floatingObjectWaves/system/controlDict +++ b/tutorials/incompressibleVoF/floatingObjectWaves/system/controlDict @@ -65,7 +65,7 @@ functions0 DebugSwitches { // Write the forcing and damping scale and force fields - // forcing 1; + forcing 1; } // ************************************************************************* //