CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Magnitude of scalarField (https://www.cfd-online.com/Forums/openfoam-programming-development/124862-magnitude-scalarfield.html)

styleworker October 14, 2013 15:50

Magnitude of scalarField
 
1 Attachment(s)
Hello foamers,

I'm calculating the magnitude via mag() function for two scalarfields qOwn and qNbr2own. It's working at the beginning, but after some iterations I'm getting the error:

Code:

#0  Foam::error::printStack(Foam::Ostream&) in "/home/of/OpenFOAM/OpenFOAM-2.2.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigSegv::sigHandler(int) in "/home/of/OpenFOAM/OpenFOAM-2.2.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 
 at sigaction.c:0
#3  Foam::tmp<Foam::Field<double> > Foam::mag<double>(Foam::UList<double> const&) in "/home/of/OpenFOAM/of-2.2.0/platforms/linux64GccDPOpt/bin/CHTinterFoam"
#4 
 in "/home/of/OpenFOAM/of-2.2.0/platforms/linux64GccDPOpt/bin/CHTinterFoam"
#5 
 in "/home/of/OpenFOAM/of-2.2.0/platforms/linux64GccDPOpt/bin/CHTinterFoam"
#6  __libc_start_main in "/lib64/libc.so.6"
#7 
 in "/home/of/OpenFOAM/of-2.2.0/platforms/linux64GccDPOpt/bin/CHTinterFoam"

qOwn and qNbr2own are defined as
Code:

qOwn =
200
(
1.2819e-312
1.2819e-312
2.24019e-316
2.24019e-316
4.1382e-11
8.2764e-11
7.09406e-11
5.91172e-11
8.86757e-11
-3.54703e-11
-5.32054e-11
-4.72937e-11
8.2764e-11
8.2764e-11
4.72937e-11
-1.18234e-11
-4.72937e-11
-8.86757e-11
-1.77351e-11
7.09406e-11
8.2764e-11
4.72937e-11
8.86757e-11
4.1382e-11
-1.30058e-10
-1.47793e-10
3.54703e-11
1.18234e-10
1.35969e-10
1.47793e-10
8.86757e-11
-5.91172e-11
-1.24146e-10
-8.86757e-11
-1.12323e-10
1.18234e-11
1.83263e-10
5.91172e-12
-5.32054e-11
-5.91172e-12
-5.91172e-12
1.12323e-10
-1.30058e-10
-7.09406e-11
1.89175e-10
-1.18234e-11
1.77351e-11
1.12323e-10
-4.72937e-11
1.30058e-10
-2.00998e-10
1.06411e-10
7.68523e-11
6.50289e-11
-1.47793e-10
-1.41881e-10
1.18234e-11
1.24146e-10
1.65528e-10
9.45874e-11
-8.86757e-11
-9.45874e-11
4.72937e-11
1.35969e-10
-1.89175e-10
-1.35969e-10
6.50289e-11
9.45874e-11
-2.95586e-11
1.12323e-10
1.77351e-11
-1.77351e-10
-7.68523e-11
5.91172e-12
1.06411e-10
2.24645e-10
1.95087e-10
-2.60115e-10
-7.09406e-11
3.25144e-10
2.12822e-10
1.59616e-10
1.7144e-10
-9.45874e-11
-1.12323e-10
3.7835e-10
4.67026e-10
-3.19233e-10
-2.54204e-10
2.4238e-10
-5.32054e-11
3.84262e-10
3.13321e-10
-2.71939e-10
5.91172e-12
-1.35969e-10
-6.50289e-11
3.90173e-10
-3.54703e-11
-1.77351e-11
1.05501e-09
1.84627e-09
1.97815e-09
6.59384e-10
6.59384e-10
9.23137e-10
1.7144e-09
7.9126e-10
1.7144e-09
1.97815e-09
1.84627e-09
1.45064e-09
1.84627e-09
9.23137e-10
1.05501e-09
1.18689e-09
1.7144e-09
1.58252e-09
7.9126e-10
1.7144e-09
1.18689e-09
1.45064e-09
2.11003e-09
1.58252e-09
1.05501e-09
2.2419e-09
1.97815e-09
1.31877e-09
9.23137e-10
1.05501e-09
6.59384e-10
1.45064e-09
1.31877e-09
9.23137e-10
1.7144e-09
1.18689e-09
1.31877e-09
1.58252e-09
1.05501e-09
1.45064e-09
1.58252e-09
1.97815e-09
1.58252e-09
1.18689e-09
1.18689e-09
2.2419e-09
1.7144e-09
6.59384e-10
2.11003e-09
9.23137e-10
2.2419e-09
7.9126e-10
2.50566e-09
1.97815e-09
2.11003e-09
1.84627e-09
1.58252e-09
1.84627e-09
2.2419e-09
9.23137e-10
1.58252e-09
2.11003e-09
1.7144e-09
2.11003e-09
9.23137e-10
1.7144e-09
1.97815e-09
1.7144e-09
1.05501e-09
1.58252e-09
7.9126e-10
1.7144e-09
1.84627e-09
9.23137e-10
9.23137e-10
1.7144e-09
1.7144e-09
2.11003e-09
1.7144e-09
1.58252e-09
9.23137e-10
9.23137e-10
2.11003e-09
1.7144e-09
1.31877e-09
1.18689e-09
1.18689e-09
1.31877e-09
1.58252e-09
1.97815e-09
1.31877e-09
9.23137e-10
1.84627e-09
9.23137e-10
1.97815e-09
1.05501e-09
7.9126e-10
6.59384e-10
1.18689e-09
1.31877e-10
)

qNbr2own =
200
(
-1.06411e-10
-1.06411e-10
-5.91172e-12
4.72937e-11
-4.1382e-11
-8.2764e-11
-7.09406e-11
-5.91172e-11
-8.86757e-11
3.54703e-11
5.32054e-11
4.72937e-11
-8.2764e-11
-8.2764e-11
-4.72937e-11
1.18234e-11
4.72937e-11
8.86757e-11
1.77351e-11
-7.09406e-11
-8.2764e-11
-4.72937e-11
-8.86757e-11
-4.1382e-11
1.30058e-10
1.47793e-10
-3.54703e-11
-1.18234e-10
-1.35969e-10
-1.47793e-10
-8.86757e-11
5.91172e-11
1.24146e-10
8.86757e-11
1.12323e-10
-1.18234e-11
-1.83263e-10
-5.91172e-12
5.32054e-11
5.91172e-12
5.91172e-12
-1.12323e-10
1.30058e-10
7.09406e-11
-1.89175e-10
1.18234e-11
-1.77351e-11
-1.12323e-10
4.72937e-11
-1.30058e-10
2.00998e-10
-1.06411e-10
-7.68523e-11
-6.50289e-11
1.47793e-10
1.41881e-10
-1.18234e-11
-1.24146e-10
-1.65528e-10
-9.45874e-11
8.86757e-11
9.45874e-11
-4.72937e-11
-1.35969e-10
1.89175e-10
1.35969e-10
-6.50289e-11
-9.45874e-11
2.95586e-11
-1.12323e-10
-1.77351e-11
1.77351e-10
7.68523e-11
-5.91172e-12
-1.06411e-10
-2.24645e-10
-1.95087e-10
2.60115e-10
7.09406e-11
-3.25144e-10
-2.12822e-10
-1.59616e-10
-1.7144e-10
9.45874e-11
1.12323e-10
-3.7835e-10
-4.67026e-10
3.19233e-10
2.54204e-10
-2.4238e-10
5.32054e-11
-3.84262e-10
-3.13321e-10
2.71939e-10
-5.91172e-12
1.35969e-10
6.50289e-11
-3.90173e-10
3.54703e-11
1.77351e-11
-1.05501e-09
-1.84627e-09
-1.97815e-09
-6.59384e-10
-6.59384e-10
-9.23137e-10
-1.7144e-09
-7.9126e-10
-1.7144e-09
-1.97815e-09
-1.84627e-09
-1.45064e-09
-1.84627e-09
-9.23137e-10
-1.05501e-09
-1.18689e-09
-1.7144e-09
-1.58252e-09
-7.9126e-10
-1.7144e-09
-1.18689e-09
-1.45064e-09
-2.11003e-09
-1.58252e-09
-1.05501e-09
-2.2419e-09
-1.97815e-09
-1.31877e-09
-9.23137e-10
-1.05501e-09
-6.59384e-10
-1.45064e-09
-1.31877e-09
-9.23137e-10
-1.7144e-09
-1.18689e-09
-1.31877e-09
-1.58252e-09
-1.05501e-09
-1.45064e-09
-1.58252e-09
-1.97815e-09
-1.58252e-09
-1.18689e-09
-1.18689e-09
-2.2419e-09
-1.7144e-09
-6.59384e-10
-2.11003e-09
-9.23137e-10
-2.2419e-09
-7.9126e-10
-2.50566e-09
-1.97815e-09
-2.11003e-09
-1.84627e-09
-1.58252e-09
-1.84627e-09
-2.2419e-09
-9.23137e-10
-1.58252e-09
-2.11003e-09
-1.7144e-09
-2.11003e-09
-9.23137e-10
-1.7144e-09
-1.97815e-09
-1.7144e-09
-1.05501e-09
-1.58252e-09
-7.9126e-10
-1.7144e-09
-1.84627e-09
-9.23137e-10
-9.23137e-10
-1.7144e-09
-1.7144e-09
-2.11003e-09
-1.7144e-09
-1.58252e-09
-9.23137e-10
-9.23137e-10
-2.11003e-09
-1.7144e-09
-1.31877e-09
-1.18689e-09
-1.18689e-09
-1.31877e-09
-1.58252e-09
-1.97815e-09
-1.31877e-09
-9.23137e-10
-1.84627e-09
-9.23137e-10
-1.97815e-09
-1.05501e-09
-7.9126e-10
-6.59384e-10
-1.18689e-09
-1.31877e-10
)

But if I try to calculate mag(mag(qOwn) - mag(qNbr2own)) I'm getting the result: mag(mag(qOwn) - mag(qNbr2own)) = 200{0}

For the sake of completeness I've attached the log file.

ngj October 14, 2013 16:08

Hi,

The line

Code:

... = 200{0}
simply tells you that the difference between each of the 200 elements in each list returns 0. The mag-operator does not yield an error, it merely utilises a short-hand notation, when all entries in a field are identical, which turns out to be the difference for your difference.

Kind regards

Niels

styleworker October 14, 2013 16:32

Thank you Niels for your answer. I've assumed, if mag(x) gives an error, so mag(mag(x)-(mag(y)) has to produce an error, too.

I've changed the definiton of qOwn from:
Code:

    const fvPatchScalarField& Town = *this; //Temperature of own face (Tsolid, if regionCoupleTemperature is set in solid bc)
    const scalarField& qOwn = kS.value()*Town.snGrad();

to
Code:

    const fvPatchScalarField& Town = *this; //Temperature of  own face (Tsolid, if regionCoupleTemperature is set in solid bc)
    scalarField qOwn = kS.value()*Town.snGrad();

Right now, the solver is still running. This change might solve the problem.


All times are GMT -4. The time now is 18:43.