|
[Sponsors] |
Define momentum source error: receive a fatal signal(Segmentation fault) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 28, 2018, 11:46 |
Define momentum source error: receive a fatal signal(Segmentation fault)
|
#1 |
New Member
Guan-Bang Wang
Join Date: Apr 2018
Posts: 14
Rep Power: 8 |
Hello,
I am trying to add a source term to the momentum equation by udf, and if I started the calculation, the error "receive a fatal signal(Segmentation fault)" will occur. One of the udf codes is as below, and if I replace "C_T_G(cell,thread)[0]" with a constant value (e.g. 1.0), the calculation can be successfully started without the error. I just wonder the problem and how I can solve it. DEFINE_SOURCE(cell_x_source, cell, thread, dS, eqn) { real source; source = Cphi*C_UDSI(cell,thread,0)*C_T_G(cell,thread)[0] + C_R(cell, thread)*(C_U(cell,thread)*C_DUDX(cell, thread)+ C_V(cell, thread)*C_DUDY(cell, thread)); dS[eqn] = C_R(cell, thread)*C_DUDX(cell, thread); return source; } Thanks a lot. |
|
April 30, 2018, 04:07 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
You have done a good job in identifying which part of your code gives the problems, it is the macro "C_T_G".
The next step is to look in the manual, what it says about this macro. Did you do this, and see the remark about "Keep temporary solver memory from being freed?"? |
|
April 30, 2018, 09:48 |
|
#3 |
New Member
Guan-Bang Wang
Join Date: Apr 2018
Posts: 14
Rep Power: 8 |
Hello, pakk.
Thank you very much for your reply, it really worked. Could you please help me with another problem? When I moved on with the calculation using my udf, the residual of the uds equation kept 0 all the time, and the udf seemed to have no impact on the results. However, I did set the momentum source, uds flux, uds diffusion coefficient, uds source as well as the corresponding boundary conditions. Did I miss other details when setting uds? Thanks. |
|
April 30, 2018, 09:55 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
It looks like Fluent thinks that your UDS is zero everywhere.
Find out why that is (mathematically) not a solution to your problem. But it could be that you specified your problem in such a way that the zero solution is valid. Tip: you should in most cases be able to find a boundary condition where you set the value of the UDS directly. If you set this to a non-zero value, then your UDS solution has to be non-zero. (I am basing this answer on very little knowledge about your simulation, so it it is just my best guess at what the problem is.) |
|
April 30, 2018, 10:14 |
|
#5 |
New Member
Guan-Bang Wang
Join Date: Apr 2018
Posts: 14
Rep Power: 8 |
Thank you for your quick reply. I will try to follow your tips and fix the boundary conditions.
|
|
Tags |
momentum source, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 | ordinary | OpenFOAM Installation | 19 | September 3, 2019 19:13 |
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 | tlcoons | OpenFOAM Installation | 13 | April 20, 2016 18:34 |
SparceImage v1.7.x Issue on MAC OS X | rcarmi | OpenFOAM Installation | 4 | August 14, 2014 07:42 |
[swak4Foam] Error bulding swak4Foam | sfigato | OpenFOAM Community Contributions | 18 | August 22, 2013 13:41 |
[swak4Foam] funkySetFields compilation error | tayo | OpenFOAM Community Contributions | 39 | December 3, 2012 06:18 |