I'm having a mistake during define variate

I’m using fenics2019, here is my problem

type or paste code here
x,t = sym.symbols('x[0] t')
f = Expression('0.01*x[0]',degree=2)
def KrW(T):   
    return (3e-25*exp(2.06/(kB*T)))/T**0.5
def S(T):  
    return 1.8e24*exp(-1.04/(kB*T))
K_adsorption = KrW(T)*S(T)**2 
side_input_flux = K_adsorption*f 
side_input_flux = sym.Piecewise((side_input_flux*0.01*t, t <= 100), (side_input_flux, True))  
side_input_flux = sym.printing.ccode(side_input_flux)
side_input_flux = Expression(side_input_flux, degree=2, t=0)

Then it occur this mistake:

TypeError                                 Traceback (most recent call last)
<ipython-input-16-ff4a65cad819> in <module>
     98 side_input_flux = K_adsorption*f    
     99 
--> 100 side_input_flux = sym.Piecewise((side_input_flux*0.01*t, t <= 100), (side_input_flux, True))    
    101 side_input_flux = sym.printing.ccode(side_input_flux)
    102 side_input_flux = Expression(side_input_flux, degree=2, t=0)

TypeError: unsupported operand type(s) for *: 'Product' and 'Symbol'

How can I improve it ?

Your example is not reproducible, as you are not providing all the definitions and imports.
Additionally, you seem to be mixing ufl and sympy, which is not advicable. Please provide the mathematical formulation of what you want to compute.

This is a partial snippet of the code, so it may not be reproducible.
My question is how to unify the UFL and sympy formats so that the formulas work correctly

This code works fine when f=0.01, but when f=Expression(‘0.01*x[0]’,degree=2), the code doesn’t work, and I’m guessing that the error occurs in the following line of code:

side_input_flux = K_adsorption*f

So what should I do?

You shouldn’t mix UFL and sympy. I see no point of creating f in the way you do. Why not just use

f = x*0.01

You could also write this whole code using ufl.conditional and ufl.lt, see various others posts on the forum, and for instance: Form compilation — FEniCS Tutorial @ Sorbonne

Thank you !
I have solve my problem by adopting your suggest.