Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

species gradient calculation UDF error — can’t find the function

    • ll00023
      Subscriber

      case: 2D, kw-sst, coal-combustion, species transport, DPM.

      to get gradient of species mass fraction.

      I use UDF code 3.2.12.6 in UDF manual.

      changes: C_VOF(c, t)  >>> C_YI(c, t, 0)  F_VOF(c, t)  >>> F_YI(c, t, 0) ).  0: volatile 

      however, it didnot produce any result of species gradient. 

      I have hooked it up. I still got the error.

    • Rob
      Forum Moderator

      It's compiled so the code is gramatially correct. The chip-exec error tends to mean something isn't calculated, but as it's not needed you get an error and the solver is able to continue. 

      If you plot UDM0 what do you see?

    • ll00023
      Subscriber

      Hi Rob, Thank you for your reply.

      I didn't see anything by plotting UDM0.

      but I found the species concentration gradient is calculated. I don't know how this happens (I have difficulty in understanding how the UDF works.).
      but I didn't find the magnitude of gradient, although the code has done the calculation. C_UDMI(c,t,0) = NV_MAG(C_UDSI_G(c,t,0)); 

      it seems the forum didn't send email to remind me that I get reply anymore. I don't know why this stops.

      thank you again.

    • Rob
      Forum Moderator

      If UDM0 is showing zero, then the field isn't being populated. So, next step is to check the scalar has a non-zero value. 

      Not sure about the emails. I just got one for the thread otherwise I'd not see any messages: given the number of threads I check I'd never keep track otherwise! 

    • ll00023
      Subscriber

       

      I got the mass fraction vol gradient.

      is the scalar UDS? as shown below.

    • ll00023
      Subscriber

      I found the scalar. it is not zero.

      when I execute execute_on_demand, I got crash. is there any procedure I need to follow?

      I compile the UDF, hook it up, add a UDM and a scalar.

      then execute execute_on_demand. then it crashed.

    • ll00023
      Subscriber

      I am confused. why I setup cases in the same way. but no mass fraction derivative shows up here. but it got UDS. UDM is zero.

    • ll00023
      Subscriber

      I guess I used different UDF codes. I got the derivative from C_UDSI_G previously.
      but I recompiled the code. let me try again.

    • Rob
      Forum Moderator

      Check you're retaining all data, using the TUI command. Fluent doesn't keep all of the gradient values between iterations for RAM/efficiency reasons. 

      /solve/set/advanced/retain-temporary-solver-mem   

      Also, try running an iteration/timestep before running the UDF commands, not all data is available following initialisation, and you are messing with scalar gradients! 

    • ll00023
      Subscriber

      You are right. I used ( rpgetvar 'species/save-gradients? ) to get those gradients.

      you mean, after I get these gradients, and when I use udf, it then crashed, right?

      Thank you, Rob.

    • Rob
      Forum Moderator

      More that if the data doesn't exist until after an iteration/time step when you try and use the nonexistent data that could trigger the crash. If you're saving gradients & have them calculated you should have something to then Execute on Demand. 

      I'd use the TUI command over the Scheme one, mainly as I'd need to look up what the rp-command was doing. That's also an rpgetvar so should tell you what's set, and not change anything. 

Viewing 10 reply threads
  • You must be logged in to reply to this topic.