You can do it simply by write a program as a density of a particular fluid as a distribution function and call it through user define functions and use it like as a other functions.
You can write it in notepad only thing you need to learn is the udf language that is easy you can download udf manual by fluent and for your problem u just need to write it for almost 3-5 lines.