View Issue Details

IDProjectCategoryView StatusLast Update
0003569OpenFOAMPatchpublic2020-10-13 10:25
Reportertniemi Assigned Towill  
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Product Versiondev 
Summary0003569: Patch to fix a bug in general distribution for Lagrangian
DescriptionIn the copy constructor of general distribution, https://github.com/OpenFOAM/OpenFOAM-dev/blob/master/src/lagrangian/distributionModels/general/general.C, the cumulative-Switch and meanValue-scalar are not being copied and this causes issues with steady tracking.

Here is a patch which adds the missing copy calls.

The fix should also be applied to OF-8.
TagsNo tags attached.

Activities

tniemi

2020-10-13 07:57

reporter  

patch.diff (560 bytes)   
diff --git a/src/lagrangian/distributionModels/general/general.C b/src/lagrangian/distributionModels/general/general.C
index c3911dd..1e10f33 100644
--- a/src/lagrangian/distributionModels/general/general.C
+++ b/src/lagrangian/distributionModels/general/general.C
@@ -144,7 +144,9 @@ Foam::distributionModels::general::general(const general& p)
     nEntries_(p.nEntries_),
     minValue_(p.minValue_),
     maxValue_(p.maxValue_),
-    integral_(p.integral_)
+    meanValue_(p.maxValue_),
+    integral_(p.integral_),
+    cumulative_(p.cumulative_)
 {}
 
 
patch.diff (560 bytes)   

tniemi

2020-10-13 07:59

reporter   ~0011589

Sorry, attached a wrong diff. Here is the correct one
patch-2.diff (561 bytes)   
diff --git a/src/lagrangian/distributionModels/general/general.C b/src/lagrangian/distributionModels/general/general.C
index c3911dd..d21f7f8 100644
--- a/src/lagrangian/distributionModels/general/general.C
+++ b/src/lagrangian/distributionModels/general/general.C
@@ -144,7 +144,9 @@ Foam::distributionModels::general::general(const general& p)
     nEntries_(p.nEntries_),
     minValue_(p.minValue_),
     maxValue_(p.maxValue_),
-    integral_(p.integral_)
+    meanValue_(p.meanValue_),
+    integral_(p.integral_),
+    cumulative_(p.cumulative_)
 {}
 
 
patch-2.diff (561 bytes)   

will

2020-10-13 10:25

manager   ~0011590

Thanks, Timo. Resolved in 8 and dev.

https://github.com/OpenFOAM/OpenFOAM-8/commit/5b09ecd3bcfa794c3a87887cfd3b6fd6276dad69
https://github.com/OpenFOAM/OpenFOAM-dev/commit/e326af2b4facb6f78e7163a2497450539a1960ca

Issue History

Date Modified Username Field Change
2020-10-13 07:57 tniemi New Issue
2020-10-13 07:57 tniemi File Added: patch.diff
2020-10-13 07:59 tniemi File Added: patch-2.diff
2020-10-13 07:59 tniemi Note Added: 0011589
2020-10-13 10:25 will Assigned To => will
2020-10-13 10:25 will Status new => resolved
2020-10-13 10:25 will Resolution open => fixed
2020-10-13 10:25 will Fixed in Version => 8
2020-10-13 10:25 will Note Added: 0011590