writing UDF in AcuSolve

New Altair Community Member
Updated by Junta_20361
Hello expert,
I'm working on a simulation where the material is a mixture of N2, Co2 & O2.
I use species transport function to define the gas mixture.
Now, the viscosity and density of this mixture will be calculated by UDF with below equation:
Gas_vis = VisO2 * specO2 + VisCo2 * specCo2 + VisN2 * (1 - specO2 - specCo2)
where VisO2, Co2, N2 are user input values; specO2 & specCo2 are species data at each elems, provide by acusolve udf.
To be honest, i don't have much experience in this domain and having trouble defining specO2 and specCo2.
Below is my definition of specO2 & specCo2:
When compiling, acusolve notified there are errors at line 50 & 51.
Could you help me check & modify it for me?
Attached is my full udf.
Thanks in advance!