CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   perodic cell zone condition (http://www.cfd-online.com/Forums/fluent/95018-perodic-cell-zone-condition.html)

Jim87 December 2, 2011 10:34

perodic cell zone condition
 
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 December 13, 2011 16:25

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

Olds88 June 25, 2014 11:14

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

Jim87 June 25, 2014 18:33

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

Olds88 June 26, 2014 10:44

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

Jim87 June 26, 2014 17:25

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)


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