CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Define momentum source error: receive a fatal signal(Segmentation fault)

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 28, 2018, 11:46
Smile 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
coewgb is on a distinguished road
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.
coewgb is offline   Reply With Quote

Old   April 30, 2018, 04:07
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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?"?
pakk is offline   Reply With Quote

Old   April 30, 2018, 09:48
Default
  #3
New Member
 
Guan-Bang Wang
Join Date: Apr 2018
Posts: 14
Rep Power: 8
coewgb is on a distinguished road
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.
coewgb is offline   Reply With Quote

Old   April 30, 2018, 09:55
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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.)
pakk is offline   Reply With Quote

Old   April 30, 2018, 10:14
Default
  #5
New Member
 
Guan-Bang Wang
Join Date: Apr 2018
Posts: 14
Rep Power: 8
coewgb is on a distinguished road
Thank you for your quick reply. I will try to follow your tips and fix the boundary conditions.
coewgb is offline   Reply With Quote

Reply

Tags
momentum source, udf

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
[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


All times are GMT -4. The time now is 00:42.