General

General

How do I rename species during calculation?

    • FAQFAQ
      Participant

      In some cases (mostly in transient simulations), it can be useful to rename one or more species time in the middle of a calculation, and then resume computing. An example is fire and smoke modeling in houses or tunnels. At the beginning of the fire, flue gases start to fill the domain. After some time, the gases reach the smoke detector and the fire doors are shut automatically. At this time, you can stop the calculation and rename the species, such as flue_gas_old, air_old, etc., and then continue the calculation. At the end of the simulation, you can then differentiate the flue gases that have been present in the domain before closing the fire doors and the flue gases that have been formed after. First, define as many User Defined Scalars (UDS) as species to rename. Then, create the same number of Custom Field Functions (CFF). Every CFF must be defined as the mole fraction of one of the species to be renamed. After this, create the same number of CFFs as above and assign one UDS to every function. Additionally, define as many new species as you want to rename with the properties of the original species. Their boundary condition values must be zero. Remember to give the new species and the CFFs reasonable names. For example, flue_gas_old, air_old. etc for the species and CFF_flue_gas_old, CFF_UDS0_flue_gas_old, etc. for the CFFs. Now, you can start the calculation. You should deactivate the equations for the UDS to save computing time. After stopping the simulation for renaming, patch the UDS first with the CFFs assigned to the computed mole fractions (flue_gas, air, etc.). By doing so, the CFFs defined second (assigned to the UDSs) will get the value of the computed species. Then, patch the mole fractions of the first species (flue_gas, air, etc) with zero, which is the computed value stored in the UDSs (the mole fraction of the species defined as the last one in the material panel cannot be patched, the value is 1.0 minus all other fractions). Now, patch the mole fractions of the additional species (flue_gas_old, air_old, etc.) with the CFFs assigned to the UDSs. By doing so, the computed values of the mole fractions are transferred to the additional defined species. The calculation can now resume, and you can also track the distribution of all species. If you have chemical reactions in your model, you will also have to define the reaction models for your additional species.