View Issue Details

IDProjectCategoryView StatusLast Update
0003231OpenFOAMBugpublic2019-05-03 17:16
Reporterjkau Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version14.10
Product Versiondev 
Fixed in Versiondev 
Summary0003231: DTCHullMoving tutorial produces strange results
DescriptionDTCHullMoving tutorial: After some seconds simulation time the hull is completely above the free surface.
OpenFOAM: dev-562040f5728e from April, 30
Steps To ReproduceJust run the tutorial for some seconds simulation time.
TagsNo tags attached.

Activities

jkau

2019-05-03 14:00

reporter  

DTCHullMoving_alpha.png (183,587 bytes)   
DTCHullMoving_alpha.png (183,587 bytes)   

jkau

2019-05-03 14:29

reporter   ~0010447

I think the problem is in rigidBodyMeshMotion::solve(), as "g" is not found by mesh().time()

jkau

2019-05-03 14:42

reporter   ~0010448

provided patch should fix the issue
g_lookup.patch (851 bytes)   
diff --git a/src/rigidBodyMeshMotion/rigidBodyMeshMotion/rigidBodyMeshMotion.C b/src/rigidBodyMeshMotion/rigidBodyMeshMotion/rigidBodyMeshMotion.C
index 3a3bb60..7d22022 100644
--- a/src/rigidBodyMeshMotion/rigidBodyMeshMotion/rigidBodyMeshMotion.C
+++ b/src/rigidBodyMeshMotion/rigidBodyMeshMotion/rigidBodyMeshMotion.C
@@ -245,10 +245,12 @@ void Foam::rigidBodyMeshMotion::solve()
 
     const scalar ramp = ramp_->value(t.value());
 
-    if (t.foundObject<uniformDimensionedVectorField>("g"))
+    Info << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1" << endl;
+
+    if (mesh().foundObject<uniformDimensionedVectorField>("g"))
     {
         g() =
-            ramp*t.lookupObject<uniformDimensionedVectorField>("g").value();
+            ramp*mesh().lookupObject<uniformDimensionedVectorField>("g").value();
     }
 
     if (test_)
g_lookup.patch (851 bytes)   

jkau

2019-05-03 15:01

reporter   ~0010449

please ignore previous patch, contains unnecessary Info statement
g_lookup-2.patch (770 bytes)   
diff --git a/src/rigidBodyMeshMotion/rigidBodyMeshMotion/rigidBodyMeshMotion.C b/src/rigidBodyMeshMotion/rigidBodyMeshMotion/rigidBodyMeshMotion.C
index 3a3bb60..6b0bc9d 100644
--- a/src/rigidBodyMeshMotion/rigidBodyMeshMotion/rigidBodyMeshMotion.C
+++ b/src/rigidBodyMeshMotion/rigidBodyMeshMotion/rigidBodyMeshMotion.C
@@ -245,10 +245,10 @@ void Foam::rigidBodyMeshMotion::solve()
 
     const scalar ramp = ramp_->value(t.value());
 
-    if (t.foundObject<uniformDimensionedVectorField>("g"))
+    if (mesh().foundObject<uniformDimensionedVectorField>("g"))
     {
         g() =
-            ramp*t.lookupObject<uniformDimensionedVectorField>("g").value();
+            ramp*mesh().lookupObject<uniformDimensionedVectorField>("g").value();
     }
 
     if (test_)
g_lookup-2.patch (770 bytes)   

henry

2019-05-03 16:01

manager   ~0010450

Thanks for diagnosing the problem and proposing a fix. This issue is in two other places, I will fix all of them test and push shortly.

henry

2019-05-03 17:16

manager   ~0010451

Resolved by commit 84e71a419a8cf7f13b56b310fa14b230231b1fa7

Issue History

Date Modified Username Field Change
2019-05-03 14:00 jkau New Issue
2019-05-03 14:00 jkau File Added: DTCHullMoving_alpha.png
2019-05-03 14:29 jkau Note Added: 0010447
2019-05-03 14:42 jkau File Added: g_lookup.patch
2019-05-03 14:42 jkau Note Added: 0010448
2019-05-03 15:01 jkau File Added: g_lookup-2.patch
2019-05-03 15:01 jkau Note Added: 0010449
2019-05-03 16:01 henry Note Added: 0010450
2019-05-03 17:16 henry Assigned To => henry
2019-05-03 17:16 henry Status new => resolved
2019-05-03 17:16 henry Resolution open => fixed
2019-05-03 17:16 henry Fixed in Version => dev
2019-05-03 17:16 henry Note Added: 0010451