What is entropy change due to mass transfer? Since entropy is an extensive property, it can change via mass transfer. But entropy change for internally reversible process is defined as $\int\frac{\delta Q}{T}$, which does not account for mass transfer. Does this mean that every process that involve mass transfer is internally irreversible? If yes then how to determine entropy in a system due to mass transfer?
 A: Mass transfer is irreversible if the mass is transferred between regions which different chemical potentials. The thought experiment to analyze this goes as follows: We start with a rigid insulated box that is divided into two parts, $A$ and $B$. If we transfer a small amount $\delta n$ from $A$ to $B$, the entropy changes in each box will be:
$$
   \delta S_A =(-\delta n)\left(\frac{\partial S_A}{\partial n}\right)_{U_A,V_A}= (-\delta n) \mu_A \\
   \delta S_B =(+\delta n)\left(\frac{\partial S_B}{\partial n}\right)_{U_B,V_B} = (+\delta n) \mu_B  
$$
and the total entropy change is
$$
\tag{1}
  \delta S_\text{tot} = (\mu_B-\mu_A)\delta n
$$
By second law $\delta S_\text{tot}$ must be positive, which restricts mass transfer to take place from high to low chemical potentials. If $\mu_A=\mu_B$ then $\delta S_\text{rev}=$ and the process is reversible. That's the case when molecules diffuse in equilibrium, or when they pass between equilibrium phases. 
Equation (1) is the basis for calculating entropy changes due to mass transfer, but it is valid only in near equilibrium. 
A: ΔS=Sf-Si=mcln(Tf/Ti),where m: mass & c: specific heat of the material.Setting initial condition Ti=1 then ΔS=S=mclnT in general.Supposed a mass transfer Δm= mB-mA we count ΔS=(mBcB-mAcA)lnT for constant temperature and ΔS=(mBcB-mAcA)ln(T2/T1) for different temperatures.
