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

perodic cell zone condition

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 2, 2011, 10:34
Default perodic cell zone condition
  #1
Member
 
Stephan Langenberg
Join Date: Sep 2011
Location: Germany
Posts: 73
Rep Power: 15
Jim87 is on a distinguished road
Working with Ansys Fluent I tried to create a peridic source term for a "solid" cell zone conduction. I simulate a transient case.

The model, the mesh, the periodic profile (I use a transient table profile) are all okay and have already run in a simulation. (the periodic table as a boundary condition [which ]).

The program gave me this Error, when I tried to calculate the simulation.


Error: chip-exec: function "u" not found.
Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: #f


I have no idea what I should do to avoid this error.

Has anyone got an idea or even a solution for this problem?

Greetings from Germany,
Jim
Jim87 is offline   Reply With Quote

Old   December 13, 2011, 16:25
Default
  #2
Member
 
Stephan Langenberg
Join Date: Sep 2011
Location: Germany
Posts: 73
Rep Power: 15
Jim87 is on a distinguished road
Hi there,

I finally found an annotation in the User Guide, that profiles can't be used to define 3D structures (for example the Heat Source in a solid Cell Zone)

Does anyone know if there is a UDF_macro or structure to converte a function (piecewise linear) into an UDF?

Greetings,
Jim
Jim87 is offline   Reply With Quote

Old   June 25, 2014, 11:14
Default
  #3
New Member
 
Eric
Join Date: Jun 2014
Posts: 18
Rep Power: 12
Olds88 is on a distinguished road
Jim,

Did you ever find a way around your error? I'm trying to simulate a heat source in a solid cell zone that varies with time and would appreciate any guidance on the topic. I am new to Fluent and have never used UDF's before.

Eric
Olds88 is offline   Reply With Quote

Old   June 25, 2014, 18:33
Default
  #4
Member
 
Stephan Langenberg
Join Date: Sep 2011
Location: Germany
Posts: 73
Rep Power: 15
Jim87 is on a distinguished road
Good for you I never remove the "Reply to thread"- button

Yes I found a conclusion that works fine. Looking in my detailed notes I can give you the UDF:

P.S: I know there are better and nicer ways to run such an UDF, but I made the experience that Fluent works propper if I don't try to use loops and program it really easy (nerarly stupid).


#include "udf.h"

DEFINE_SOURCE (waermeperiode, c, t, dS, eqn)
{real flow_time = CURRENT_TIME;
double heat_flux=0.0;
{
if (flow_time > 1193.36)
heat_flux = 0.1;
else if (flow_time >= 2.24 && flow_time <= 2.96)
heat_flux = 933267107.2;
else if (flow_time >= 27.04 && flow_time <= 27.76)
heat_flux = 933267107.2;
else if (flow_time >= 51.84 && flow_time <= 52.56)
heat_flux = 933267107.2;
else if (flow_time >= 76.64 && flow_time <= 77.36)
heat_flux = 933267107.2;
else if (flow_time >= 101.44 && flow_time <= 102.16)
heat_flux = 933267107.2;
else if (flow_time >= 126.24 && flow_time <= 126.96)
heat_flux = 933267107.2;
else if (flow_time >= 151.04 && flow_time <= 151.76)
heat_flux = 933267107.2;
else if (flow_time >= 175.84 && flow_time <= 176.56)
heat_flux = 933267107.2;
else if (flow_time >= 200.64 && flow_time <= 201.36)
heat_flux = 933267107.2;
else if (flow_time >= 225.44 && flow_time <= 226.16)
heat_flux = 933267107.2;
else if (flow_time >= 250.24 && flow_time <= 250.96)
heat_flux = 933267107.2;
else if (flow_time >= 275.04 && flow_time <= 275.76)
heat_flux = 933267107.2;
else if (flow_time >= 299.84 && flow_time <= 300.56)
heat_flux = 933267107.2;
else if (flow_time >= 324.64 && flow_time <= 325.36)
heat_flux = 933267107.2;
else if (flow_time >= 349.44 && flow_time <= 350.16)
heat_flux = 933267107.2;
else if (flow_time >= 374.24 && flow_time <= 374.96)
heat_flux = 933267107.2;
else if (flow_time >= 399.04 && flow_time <= 399.76)
heat_flux = 933267107.2;
else if (flow_time >= 423.84 && flow_time <= 424.56)
heat_flux = 933267107.2;
else if (flow_time >= 448.64 && flow_time <= 449.36)
heat_flux = 933267107.2;
else if (flow_time >= 473.44 && flow_time <= 474.16)
heat_flux = 933267107.2;
else if (flow_time >= 498.24 && flow_time <= 498.96)
heat_flux = 933267107.2;

else if (flow_time >= 523.04 && flow_time <= 523.76)
heat_flux = 933267107.2;
else if (flow_time >= 547.84 && flow_time <= 548.56)
heat_flux = 933267107.2;
else if (flow_time >= 572.64 && flow_time <= 573.36)
heat_flux = 933267107.2;
else if (flow_time >= 597.44 && flow_time <= 598.16)
heat_flux = 933267107.2;
else if (flow_time >= 622.24 && flow_time <= 622.96)
heat_flux = 933267107.2;
else if (flow_time >= 647.04 && flow_time <= 647.76)
heat_flux = 933267107.2;
else if (flow_time >= 671.84 && flow_time <= 672.56)
heat_flux = 933267107.2;
else if (flow_time >= 696.64 && flow_time <= 697.36)
heat_flux = 933267107.2;
else if (flow_time >= 721.44 && flow_time <= 722.16)
heat_flux = 933267107.2;
else if (flow_time >= 746.24 && flow_time <= 746.96)
heat_flux = 933267107.2;
else if (flow_time >= 771.04 && flow_time <= 771.76)
heat_flux = 933267107.2;
else if (flow_time >= 795.84 && flow_time <= 796.56)
heat_flux = 933267107.2;
else if (flow_time >= 820.64 && flow_time <= 821.36)
heat_flux = 933267107.2;
else if (flow_time >= 845.44 && flow_time <= 846.16)
heat_flux = 933267107.2;
else if (flow_time >= 870.24 && flow_time <= 870.96)
heat_flux = 933267107.2;
else if (flow_time >= 895.04 && flow_time <= 895.76)
heat_flux = 933267107.2;
else if (flow_time >= 919.84 && flow_time <= 920.56)
heat_flux = 933267107.2;
else if (flow_time >= 944.64 && flow_time <= 945.36)
heat_flux = 933267107.2;
else if (flow_time >= 969.44 && flow_time <= 970.16)
heat_flux = 933267107.2;
else if (flow_time >= 994.24 && flow_time <= 994.96)
heat_flux = 933267107.2;
else if (flow_time >= 1019.04 && flow_time <= 1019.76)
heat_flux = 933267107.2;
else if (flow_time >= 1043.84 && flow_time <= 1044.56)
heat_flux = 933267107.2;
else if (flow_time >= 1068.64 && flow_time <= 1069.36)
heat_flux = 933267107.2;
else if (flow_time >= 1093.44 && flow_time <= 1094.16)
heat_flux = 933267107.2;
else
heat_flux = 0.0;
}
return heat_flux;
}

//you see, the program (adressing etc. is really short. Making this file to a loop function shouldn't be so hard.

Maybe inform me and the forum if there are questions.

Good luck
Jim87 is offline   Reply With Quote

Old   June 26, 2014, 10:44
Default
  #5
New Member
 
Eric
Join Date: Jun 2014
Posts: 18
Rep Power: 12
Olds88 is on a distinguished road
Jim,

Thanks a lot for your help and for replying even though this thread is a few years old! I'm taking your suggestions and have successfully run some short simulations and it seems to be working well.

Perhaps you can answer another question. I'm trying to use adaptive time-stepping but I'm a little confused about the simulation ending time. I set the ending time in the adaptive time step settings, but the simulation ends once the set number of time steps as been reached, even if the ending time has not been reached. Why does Fluent still look at the number of time steps I requested? I figured it would ignore this and just do as many steps as needed to reach the ending time I requested. I got around this by just setting the number of time steps to a very high number, but this doesn't seem like the ideal solution.

Thanks,

Eric
Olds88 is offline   Reply With Quote

Old   June 26, 2014, 17:25
Default
  #6
Member
 
Stephan Langenberg
Join Date: Sep 2011
Location: Germany
Posts: 73
Rep Power: 15
Jim87 is on a distinguished road
Glad to hear that my file is useful,

I have to say that I never used the advanced time setting. If you have "problems" with your time step dimension or the iterations for every timestep I'm the wrong conversational partner.

You don't descripe your model (or the physics behind it), so it's hard to say if the advanced time-steps are necessary.

a few ideas

1. Do you need lower time steps for the initiation (and the first following steps)?
-> Then you can write a short scribt for the timestep function or make a manual brake and reset the time step dimension.

2. Is your problem periodic? This could be a problem, if you wan't to get a clear convergation (maybe it repeats " harmonic") but a conversation (like insteady state models isn't your goal)
Jim87 is offline   Reply With Quote

Old   September 18, 2015, 04:53
Smile Cheers
  #7
New Member
 
Lamboram
Join Date: Jul 2011
Location: Munich
Posts: 16
Rep Power: 15
lamboram is on a distinguished road
Quote:
Originally Posted by Jim87 View Post
Good for you I never remove the "Reply to thread"- button

Yes I found a conclusion that works fine. Looking in my detailed notes I can give you the UDF:

P.S: I know there are better and nicer ways to run such an UDF, but I made the experience that Fluent works propper if I don't try to use loops and program it really easy (nerarly stupid).


#include "udf.h"

DEFINE_SOURCE (waermeperiode, c, t, dS, eqn)
{real flow_time = CURRENT_TIME;
double heat_flux=0.0;
{
if (flow_time > 1193.36)
heat_flux = 0.1;
else if (flow_time >= 2.24 && flow_time <= 2.96)
heat_flux = 933267107.2;
else if (flow_time >= 27.04 && flow_time <= 27.76)
heat_flux = 933267107.2;
else if (flow_time >= 51.84 && flow_time <= 52.56)
heat_flux = 933267107.2;
else if (flow_time >= 76.64 && flow_time <= 77.36)
heat_flux = 933267107.2;
else if (flow_time >= 101.44 && flow_time <= 102.16)
heat_flux = 933267107.2;
else if (flow_time >= 126.24 && flow_time <= 126.96)
heat_flux = 933267107.2;
else if (flow_time >= 151.04 && flow_time <= 151.76)
heat_flux = 933267107.2;
else if (flow_time >= 175.84 && flow_time <= 176.56)
heat_flux = 933267107.2;
else if (flow_time >= 200.64 && flow_time <= 201.36)
heat_flux = 933267107.2;
else if (flow_time >= 225.44 && flow_time <= 226.16)
heat_flux = 933267107.2;
else if (flow_time >= 250.24 && flow_time <= 250.96)
heat_flux = 933267107.2;
else if (flow_time >= 275.04 && flow_time <= 275.76)
heat_flux = 933267107.2;
else if (flow_time >= 299.84 && flow_time <= 300.56)
heat_flux = 933267107.2;
else if (flow_time >= 324.64 && flow_time <= 325.36)
heat_flux = 933267107.2;
else if (flow_time >= 349.44 && flow_time <= 350.16)
heat_flux = 933267107.2;
else if (flow_time >= 374.24 && flow_time <= 374.96)
heat_flux = 933267107.2;
else if (flow_time >= 399.04 && flow_time <= 399.76)
heat_flux = 933267107.2;
else if (flow_time >= 423.84 && flow_time <= 424.56)
heat_flux = 933267107.2;
else if (flow_time >= 448.64 && flow_time <= 449.36)
heat_flux = 933267107.2;
else if (flow_time >= 473.44 && flow_time <= 474.16)
heat_flux = 933267107.2;
else if (flow_time >= 498.24 && flow_time <= 498.96)
heat_flux = 933267107.2;

else if (flow_time >= 523.04 && flow_time <= 523.76)
heat_flux = 933267107.2;
else if (flow_time >= 547.84 && flow_time <= 548.56)
heat_flux = 933267107.2;
else if (flow_time >= 572.64 && flow_time <= 573.36)
heat_flux = 933267107.2;
else if (flow_time >= 597.44 && flow_time <= 598.16)
heat_flux = 933267107.2;
else if (flow_time >= 622.24 && flow_time <= 622.96)
heat_flux = 933267107.2;
else if (flow_time >= 647.04 && flow_time <= 647.76)
heat_flux = 933267107.2;
else if (flow_time >= 671.84 && flow_time <= 672.56)
heat_flux = 933267107.2;
else if (flow_time >= 696.64 && flow_time <= 697.36)
heat_flux = 933267107.2;
else if (flow_time >= 721.44 && flow_time <= 722.16)
heat_flux = 933267107.2;
else if (flow_time >= 746.24 && flow_time <= 746.96)
heat_flux = 933267107.2;
else if (flow_time >= 771.04 && flow_time <= 771.76)
heat_flux = 933267107.2;
else if (flow_time >= 795.84 && flow_time <= 796.56)
heat_flux = 933267107.2;
else if (flow_time >= 820.64 && flow_time <= 821.36)
heat_flux = 933267107.2;
else if (flow_time >= 845.44 && flow_time <= 846.16)
heat_flux = 933267107.2;
else if (flow_time >= 870.24 && flow_time <= 870.96)
heat_flux = 933267107.2;
else if (flow_time >= 895.04 && flow_time <= 895.76)
heat_flux = 933267107.2;
else if (flow_time >= 919.84 && flow_time <= 920.56)
heat_flux = 933267107.2;
else if (flow_time >= 944.64 && flow_time <= 945.36)
heat_flux = 933267107.2;
else if (flow_time >= 969.44 && flow_time <= 970.16)
heat_flux = 933267107.2;
else if (flow_time >= 994.24 && flow_time <= 994.96)
heat_flux = 933267107.2;
else if (flow_time >= 1019.04 && flow_time <= 1019.76)
heat_flux = 933267107.2;
else if (flow_time >= 1043.84 && flow_time <= 1044.56)
heat_flux = 933267107.2;
else if (flow_time >= 1068.64 && flow_time <= 1069.36)
heat_flux = 933267107.2;
else if (flow_time >= 1093.44 && flow_time <= 1094.16)
heat_flux = 933267107.2;
else
heat_flux = 0.0;
}
return heat_flux;
}

//you see, the program (adressing etc. is really short. Making this file to a loop function shouldn't be so hard.

Maybe inform me and the forum if there are questions.

Good luck
Dear Jim,

thank you for your code. It helped me understand me first UDF for source term.

Cheers,
Ram
lamboram is offline   Reply With Quote

Reply


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
[ICEM] Export ICEM mesh to Gambit / Fluent romekr ANSYS Meshing & Geometry 1 November 26, 2011 13:11
Cells with t below lower limit Purushothama Siemens 2 May 31, 2010 22:58
splitMesh error - point, face or cell zone already exists#0 nikwin OpenFOAM 1 January 27, 2010 05:31
Error to re-open fluent case file J.Gimbun FLUENT 0 April 27, 2006 09:42
How to put a cell in a different zone Bikash Main CFD Forum 0 October 24, 2003 13:49


All times are GMT -4. The time now is 16:54.