Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
Materials

Materials

Topics related to Granta Design and more.

Problem with User Defined Materialdatabase

    • ben.ludwig
      Subscriber

      Hey I want to setup my own Materialdatabase, the problem I am having is that after I set one property the unit of the next property doesn´t change and it seems that in the .scm file it throws a random error because it is trying to set the value of the previous property to the new property.

      The Terminal in Fluent then outputs either:

      Error: CAR: invalid argument [1]: wrong type [not a pair]

      Error Object: ()


      And/ or

      Error: GENERAL-CAR-CDR: invalid argument [1]: improper list

      And the .scm file then looks like this (without the header):

      (
          (lithium-gas fluid
              (chemical-formula . li)
              (specific-heat)
              (density)
              (latent-heat)
              (thermal-conductivity)
              (vaporization-temperature (user-defined "lithium_sat_temp::libudf") (constant . 1615.) (expression . "6.58e-5 [kg m^-1 s^-1] * exp(1153.5 [K]/StaticTemperature)"))
              (viscosity (expression . "6.58e-5 [kg m^-1 s^-1] * exp(1153.5 [K]/StaticTemperature)") (constant . 0.0001))
              (saturation-pressure (constant . 1615.) (user-defined "lithium_sat_temp::libudf") (expression . "6.58e-5 [kg m^-1 s^-1] * exp(1153.5 [K]/StaticTemperature)"))
          )

      )

      And the error is obvious because saturation-pressure and vaporization-temperature have the same blocks and a expression is not available for vaporization-temperature (only UDF or constant)

      Ignore the unfilled properties, the same Error (CAR-CDR) throws as well, when all are filled, which again is not possible because the .scm file doesn´t write properly

      Answer from the ANSYS Assistant is included

      Thanks

    • AnsysGPT

      Question to Ansys Assistant

      Hey I want to setup my own Materialdatabase, the problem I am having is that after I set one property the unit of the next property doesn´t change and it seems that in the .scm file it throws a random error because it is trying to set the value of the previous property to the new property. The Terminal in Fluent then outputs either: Error: CAR: invalid argument [1]: wrong type [not a pair] Error Object: () And/ orError: GENERAL-CAR-CDR: invalid argument [1]: improper listAnd the .scm file then looks like this (without the header): (    (lithium-gas fluid        (chemical-formula . li)        (specific-heat)        (density)        (latent-heat)        (thermal-conductivity)        (vaporization-temperature (user-defined "lithium_sat_temp::libudf") (constant . 1615.) (expression . "6.58e-5 [kg m^-1 s^-1] * exp(1153.5 [K]/StaticTemperature)"))        (viscosity (expression . "6.58e-5 [kg m^-1 s^-1] * exp(1153.5 [K]/StaticTemperature)") (constant . 0.0001))        (saturation-pressure (constant . 1615.) (user-defined "lithium_sat_temp::libudf") (expression . "6.58e-5 [kg m^-1 s^-1] * exp(1153.5 [K]/StaticTemperature)"))    ) ) And the error is obvious because saturation-pressure and vaporization-temperature have the same blocks and a expression is not available for vaporization-temperature (only UDF or constant)

      Response from Ansys Assistant

      Based on what I know, Fluent requires user-defined material databases (.scm) to follow a strict Scheme-list structure, where each material is a single parenthesized list and each property is its own parenthesized sublist; an example given is: ((air fluid ... ) (aluminum solid ... )), with each property defined as a separate list such as (density (constant 1.225) ...), and any missing or mismatched parentheses can cause errors like “GENERAL-CAR-CDR: invalid argument [1]: improper list.” 9.1. Defining Materials

      However, I do not have information that explicitly shows the correct .scm syntax for lithium-gas, nor for the specific properties “vaporization-temperature” and “saturation-pressure,” nor how to mix expression/constant/UDF for those two properties inside a .scm file; therefore I cannot state how to structure those specific property blocks to avoid cross-contamination or exactly why your viscosity expression is spilling into the next property beyond the general warning that improper or missing list delimiters will trigger the Scheme errors you observe. The provided information does not say how those particular properties must be written in the .scm file, so to proceed safely I recommend using Fluent’s Material Editor to create a lithium-gas material with the desired options (constant, expression, or UDF where allowed), then exporting that material to a user-defined database and using the resulting file as the template, or contacting Ansys Support for precise examples of the correct property syntax. 9.1. Defining Materials

      Would you like to go over the steps to export a material from Fluent and use that exported .scm snippet as a template for your lithium-gas definition?

    • Rob
      Channel Partner

      The User materials in Fluent can throw the odd problem because of the number of possible properties that are, or are not required. You've also pulled in a UDF which isn't stored in the Scheme file so there's a good chance loading the database will create further issues. 

      My approach is to set up a dummy Fluent model with everything you will need switched on. Ie turbulence, energy, radiation etc and then Edit and do NOT overwrite air or aluminium to give the new material. Save that to the new database. It's much harder to get a bracket or syntax wrong when filling in the GUI.....  One warning with material databases is that if you create a model, load the database and then switch on something that needs another material (DPM model is notorious for this) Fluent may not find the new material in the user database. Again, fully set up the new model before reading the materials; or load a material from Fluent's database after loading the user database. 

Viewing 2 reply threads
  • You must be logged in to reply to this topic.
[bingo_chatbox]