Usr_properties.f problem

I am struggling a bit truing to get my UDF for viscosity and density of water to work for my simulations. i have edited the Usr_properties.f file such that it has the formulas i want to use for calculating density and viscosity based on the temperature. However every time i try to run it i receive the error. Does anyone see what i am doing wrong?

I will attach the UDF here usr_properties.f (35.9 KB)

Thank you,
Kwasi

When you say ā€œi receive the errorā€, it isnā€™t very clear. Nevertheless, I examined your attached file and in both modified subroutines I see the following line:

! if using this quantity then remove definition of ier
ier = 1

To me this means that if you want MFIX use that subroutine then you must remove the definition of IER.

I suggest removing it and seeing if that gets you past ā€˜theā€™ error. For an example, see tutorials/tfm/Absorption_column_2d/. This case makes use of usr_properties.f for the secondary phase density/viscosity/conductivity/diffusivity.

2 Likes

Hello,
thank you for your response. I realized this after i posted it and fixed this. However even with that i am still unable to get it to run with my case. After i insert the file into my directory and recompile it runs but the time step will decrease and it will error out. I am not sure if this is because of the equations i used for the density and viscosity because even when i put constant values it still doesnā€™t run properly

If you put in constant values through the standard keywords (mu_g0, ro_g0) does it also not run? If so, then you may need to reconsider your setup/IC or complexity (simplify until it runs then bring things in). If it does run, then I suggest applying the same principle by adding one thing at a time, i.e., start with variable viscosity, check that it runs, if so, then add variable density.

That said, as I see it now, a general inconsistency exists in the code for dealing with input into usr_prop_rog as it comes into play in the pressure/continuity equation (the same is not true for usr_prop_ros). Namely, MFIX allows for slight compressibility in the context of the pressure correction equation (fluid) by including a term to account for the effect of pressure on density. This is all done through an assumed equation of state (the ideal gas law) and is hard-coded in functions in eos_mod.f: eosg and droodp_g. If you do not supply a constant value for ro_g0, then MFIX logic will apply your density function but also assume slight compressibility as determined by the hard-coded droodp_g term.

Since your density equation is only a function of temperature the code should treat it as incompressible or use zero for droodp_g. A potential ā€˜quickā€™ fix is to go into eos_mod and simply set droodp_g to zero until this can be addressed otherwise.