CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Magnitude of scalarField

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 14, 2013, 15:50
Default Magnitude of scalarField
  #1
Member
 
Join Date: May 2012
Posts: 55
Rep Power: 14
styleworker is on a distinguished road
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.
Attached Files
File Type: gz log.txt.tar.gz (16.1 KB, 2 views)
styleworker is offline   Reply With Quote

Old   October 14, 2013, 16:08
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
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
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   October 14, 2013, 16:32
Default
  #3
Member
 
Join Date: May 2012
Posts: 55
Rep Power: 14
styleworker is on a distinguished road
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.
styleworker is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a symmTensorField from a scalarField maninthemail OpenFOAM 13 April 22, 2023 06:43
Face area magnitude inconsistency when exporting ReeKo FLUENT 6 February 21, 2021 20:10
Magnitude of a tensor mmkr825 OpenFOAM Programming & Development 8 December 12, 2018 13:49
Output velocity magnitude satellite_control FLOW-3D 1 November 30, 2011 19:07
Stresseq vs stress magnitude watashiwa OpenFOAM 1 October 14, 2010 12:02


All times are GMT -4. The time now is 09:59.