CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Subdomain initialisation? (https://www.cfd-online.com/Forums/cfx/174815-subdomain-initialisation.html)

masands July 19, 2016 05:43

Subdomain initialisation?
 
Hi,

I have 2 fluids in my model. I want a certain volume of the mesh to be only filled with Fluid A and the rest with Fluid B at initial conditions. Is that possible to do in CFX? The regions are overlapping so I can't use simple expressions. Can I do it using subdomains?

In Fluent, I could do this using the Patch Volume option.

Thanks!

ghorrocks July 19, 2016 06:01

I assume you are setting volume fraction or mass fractions.

You can define subdomains as any named region of mesh and define initial conditions based on that. Also with recent version of CFX you can use the inside()@region CEL command to tell when you are inside a mesh region which you can use to make initial conditions using CEL.

masands July 19, 2016 06:33

Quote:

Originally Posted by ghorrocks (Post 610210)
I assume you are setting volume fraction or mass fractions.

You can define subdomains as any named region of mesh and define initial conditions based on that. Also with recent version of CFX you can use the inside()@region CEL command to tell when you are inside a mesh region which you can use to make initial conditions using CEL.

Thanks! That's what I was hoping to do - define initial volume fractions

Could you just walk me through the steps? I've created a new subdomain (let's call it SubDomA). However, under "Default Domain" --> Initial Conditions, I don't see any options to select this subdomain. Can you do it this way?

Alternatively, like you said with expressions...
I'm a bit of noob with expressions but I'm guessing it would go like this:

InitVolFluidA = if(inside(SubDomA)@region, 1, 0))
InitVolFluidB = 1-InitVolFluidA

Then just set those expressions under domain, initialisation for each fluid. Would that do it?

Thanks a lot for your time!

ghorrocks July 19, 2016 06:39

I think the syntax is inside()@region, where region is the name of the region in the mesh. Look in the CFX reference guide for the syntax of these CEL commands and variable names.

You do not need to define fluid B. The automatic setting will just set it to 1-A.

You can also set initial conditions directly on the sub domain tab.

masands July 19, 2016 06:42

Ah Ok, got it. The subdomain tab itself does not have an initialisation option, however, I think I got it figured out using mesh regions and the inside() command. The command returns a '1' if true so I can just set ths expression as my initial condition directly.

Thanks a lot for your help!


All times are GMT -4. The time now is 21:23.