View Issue Details

IDProjectCategoryView StatusLast Update
0004128OpenFOAMBugpublic2024-08-10 22:24
Reportertniemi Assigned Tohenry  
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Product Versiondev 
Fixed in Versiondev 
Summary0004128: Zonal solid thermo, wrong properties at processor boundaries
DescriptionHi,

When using zonal-method to specify eg. kappa (or Cv,rho) in solid thermo, the processor boundaries get populated with cell values of the current processor instead of the values of the neighbouring processor. This leads to issues if the processor boundary happens to lie in between two zones. (Which can occur in practical cases, as unlikely as it may sound :) )

I have attached an example patch with vtf.correctBoundaryConditions() which appears to solve the issue.

Also, the error message "Valid type entries are 'uniform' or 'file' for " is missing the zonal-option.
Steps To ReproduceAttached is a simple 1D case with two zones with different kappa and decomposed into two domains so that the zone switches when the processor changes.

Run ./Allrun, check logs:

Serial

writing object wallHeatFlux
min, max, Q [W], q [W/m^2] for patch wall_left = 2079.63084, 2079.63085, 0.207963084, 2079.63084
min, max, Q [W], q [W/m^2] for patch wall_right = -2080.67443, -2080.67433, -0.208067439, -2080.67439

-> conserves energy

Parallel

writing object wallHeatFlux
min, max, Q [W], q [W/m^2] for patch wall_left = 1120.72926, 1120.72973, 0.112072939, 1120.72939
min, max, Q [W], q [W/m^2] for patch wall_right = -94610.3613, -94610.3156, -9.46103373, -94610.3373
min, max, Q [W], q [W/m^2] for patch wall_topBottom = 0, 0, 0, 0

-> conservation error

Also, in eg. processor0/500/solid/kappa

internalField uniform 1;

procBoundary0to1
{
    type processor;
    value uniform 1; // Should be 100
}
TagsNo tags attached.

Activities

tniemi

2024-08-06 13:03

reporter  

zonalBug.tar.gz (2,424 bytes)
zonalFix.diff (993 bytes)   
diff --git a/src/thermophysicalModels/solidThermo/constSolidThermo/constSolidThermoTemplates.C b/src/thermophysicalModels/solidThermo/constSolidThermo/constSolidThermoTemplates.C
index 7e2241bd6c..45edabbc1a 100644
--- a/src/thermophysicalModels/solidThermo/constSolidThermo/constSolidThermoTemplates.C
+++ b/src/thermophysicalModels/solidThermo/constSolidThermo/constSolidThermoTemplates.C
@@ -107,6 +107,8 @@ Foam::VolField<Type> Foam::constSolidThermo::readProperty
             Info << endl;
         }
 
+        vtf.correctBoundaryConditions();
+
         return vtf;
     }
     else if (propType == "file")
@@ -127,7 +129,8 @@ Foam::VolField<Type> Foam::constSolidThermo::readProperty
     else
     {
         FatalErrorInFunction
-            << "Valid type entries are 'uniform' or 'file' for " << name
+            << "Valid type entries are "
+            << "'uniform', 'zonal' or 'file' for " << name
             << abort(FatalError);
 
         return VolField<Type>::null();
zonalFix.diff (993 bytes)   

henry

2024-08-10 22:24

manager   ~0013359

Thanks for the bug-report and patch

Resolved in OpenFOAM-dev by commit 9cd60f594b691f250b4d9c45108e0b27026f7e69

Issue History

Date Modified Username Field Change
2024-08-06 13:03 tniemi New Issue
2024-08-06 13:03 tniemi File Added: zonalBug.tar.gz
2024-08-06 13:03 tniemi File Added: zonalFix.diff
2024-08-10 22:24 henry Assigned To => henry
2024-08-10 22:24 henry Status new => resolved
2024-08-10 22:24 henry Resolution open => fixed
2024-08-10 22:24 henry Fixed in Version => dev
2024-08-10 22:24 henry Note Added: 0013359