View Issue Details

IDProjectCategoryView StatusLast Update
0004261OpenFOAMBugpublic2025-08-08 13:45
Reportertobias2 Assigned Tohenry  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
PlatformGNU/LinuxOSOtherOS Version(please specify)
Product Version13 
Summary0004261: Wrong residual calculation for zone-wise defined solid material properties
DescriptionWith a multi-region CHT case a zone-wise definition of solid material properties in physicalProperties delivers a wrong residuals for this region. As the calculated valuesare very low, the tolerance in fvSolution/solvers has no effect and the region will never be calculated.

example form the log-file for the first itme-step, where the inital residual should be 1:
solid1 DICPCG: Solving for e, Initial residual = 5.4645654e-07, Final residual = 5.4645654e-07, No Iterations 0

with fvSolution:

solvers
{
    "(h|e)"
    {
        solver PCG;
        preconditioner DIC;
        tolerance 1e-06;
        relTol 0.01;
    }
}
no calculation will be executed for solid1

Workaround: setting the tolerance, relTol very low or minIter.


e.g. for physicalProperties:
thermoType constSolidThermo;

    rho
    {
        type zonal;
        value 7850;

        zones
        {
           iron 7850;
           copper 8940;
           alu 2700;
        }
    }

    Cv
    {
        type zonal;
        value 750;

        zones
        {
           iron 450;
           copper 385;
           alu 900;
        }
    }

    kappa
    {
        type zonal;
        value 4;

        zones
        {
           iron 50;
           copper 380;
           alu 200;
        }
    }
TagsNo tags attached.

Activities

henry

2025-08-07 09:22

manager   ~0013636

It is not clear in what way the residuals for a region would be wrong, the residuals are calculated directly from the matrix, for the residuals to be wrong the matrix would have to be wrong.
We will need a small test-case which reproduces the problem, without a case we cannot reproduce it.

tobias2

2025-08-07 13:54

reporter   ~0013638

Attatched you find a testcase with a fluid region and two solid regions that are next to the fluid region. The region solid2 contains 3 zones with different material properties. The energy equation of solid2 is never solved as the inital residual of the first timestep is lower than the tolerance in solid2/fvSolution. When the tolerance is tightned the equation will be solved.

henry

2025-08-07 14:17

manager   ~0013639

This all looks correct, you need to tighten the tolerance for the equation to solve.

cgoessni

2025-08-07 18:21

reporter   ~0013640

You can also set minIter to e.g. 1, to have the matrix-vector equation at least once iterated through by the solver. We often set minIter 1 in our simulations since our initial matrix solver residual is voften ery small as well.

tobias2

2025-08-08 13:29

reporter   ~0013642

But does the tolerance setting in fvSolution work as intendet when it is not guaranteed that the inital residual for the first timestep is 1? I find it a bit hard to choose a appropriate tolerance and minIter setting, when there is no guarantee about the absolute residual values.

henry

2025-08-08 13:45

manager   ~0013643

The residual is normalise with respect to the matrix not the initial condition.

henry

2025-08-08 13:45

manager   ~0013644

User support request.

Issue History

Date Modified Username Field Change
2025-08-07 08:54 tobias2 New Issue
2025-08-07 09:22 henry Note Added: 0013636
2025-08-07 13:54 tobias2 Note Added: 0013638
2025-08-07 13:54 tobias2 File Added: zonalHeatConductivityResiduals.zip
2025-08-07 14:17 henry Note Added: 0013639
2025-08-07 18:21 cgoessni Note Added: 0013640
2025-08-08 13:29 tobias2 Note Added: 0013642
2025-08-08 13:45 henry Note Added: 0013643
2025-08-08 13:45 henry Assigned To => henry
2025-08-08 13:45 henry Status new => closed
2025-08-08 13:45 henry Resolution open => no change required
2025-08-08 13:45 henry Note Added: 0013644