View Issue Details

IDProjectCategoryView StatusLast Update
0003302OpenFOAMBugpublic2019-07-04 14:33
Reporterjkau Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version14.04
Product Versiondev 
Fixed in Versiondev 
Summary0003302: verticalDamping crashes since introduction of isotropicDamping
DescriptionUsing verticalDamping in e.g. the DTCHullMoving tutorial causes the solver to crash . This happens since commit 251f91cfa568881fccde70ae9eb6ccba8d784ed0 ("fvOptions::isotropicDamping: New wave damping fvOption").
Steps To Reproduceinclude verticalDamping in DTCHullMoving tutorial:
option1
{
type verticalDamping;
selectionMode all;
origin (-3 0 0);
direction (-1 0 0);
scale
{
type quadraticRamp;
start 0;
duration 6;
}
lambda 22;
timeStart 0;
duration 1e6;

}
Additional InformationWhat is noticeable, that the cell volumne is not accouted for anymore in the calculation of the damping force. In previous version this was:
force[i] = V[c]*s[c](lgg.value() & alphaRhoU[c]);
with V being the cell volumes.
TagsNo tags attached.

Activities

henry

2019-07-03 16:08

manager   ~0010548

> What is noticeable, that the cell volumne is not accouted for anymore in the calculation of the damping force

Are you sure? In

    eqn -= forceCoeff()*(gg & alphaRhoU());

the volume should be accounted for in the "-=" operator.

henry

2019-07-03 16:37

manager   ~0010549

I checked the matrix generated by the verticalDamping functionObject for the tutorials/multiphase/interFoam/laminar/wave case in OpenFOAM-6 and OpenFOAM-dev and they are identical.

jkau

2019-07-04 08:48

reporter   ~0010550

Yes, you are right. However, I did some more testing, the different behaviour only arises when using multiple zones, i.e. list of originis and directions. The forceCoeff field is multiplied for each damping region with the coefficient, but this should only be done one. Attached patch fixes this.
damping.patch (911 bytes)   
diff --git a/src/fvOptions/sources/derived/damping/damping/damping.C b/src/fvOptions/sources/derived/damping/damping/damping.C
index 5c7c395..395aebc 100644
--- a/src/fvOptions/sources/derived/damping/damping/damping.C
+++ b/src/fvOptions/sources/derived/damping/damping/damping.C
@@ -58,15 +58,15 @@ Foam::tmp<Foam::volScalarField::Internal> Foam::fv::damping::forceCoeff() const
     );
     scalarField& forceCoeff = tforceCoeff.ref();
 
-    const scalar lambda = lambda_.value();
-
     forAll(origins_, i)
     {
         const vectorField& c = mesh_.cellCentres();
         const scalarField x((c - origins_[i]) & directions_[i]);
-        forceCoeff = lambda*max(forceCoeff, scale_->value(x));
+        forceCoeff = max(forceCoeff, scale_->value(x));
     }
 
+    forceCoeff *= lambda_.value();
+
     // Write out the force coefficient for debugging
     if (debug && mesh_.time().writeTime())
     {
damping.patch (911 bytes)   

henry

2019-07-04 14:33

manager   ~0010551

Thanks for the clarification and patch

Resolved by commit 1cd4b292eb94446d0aae9d34b096e8a1da93630a

Issue History

Date Modified Username Field Change
2019-07-03 15:57 jkau New Issue
2019-07-03 16:08 henry Note Added: 0010548
2019-07-03 16:37 henry Note Added: 0010549
2019-07-04 08:48 jkau File Added: damping.patch
2019-07-04 08:48 jkau Note Added: 0010550
2019-07-04 14:33 henry Assigned To => henry
2019-07-04 14:33 henry Status new => resolved
2019-07-04 14:33 henry Resolution open => fixed
2019-07-04 14:33 henry Fixed in Version => dev
2019-07-04 14:33 henry Note Added: 0010551