CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Boundary condition for an additional variable on the interface of two domains (https://www.cfd-online.com/Forums/cfx/223386-boundary-condition-additional-variable-interface-two-domains.html)

katty17 January 8, 2020 14:37

Boundary condition for an additional variable on the interface of two domains
 
Hi Glenn,


I want to solve additional transport equation for a new variable in CFX. My problem comprises two domains that are connected to each other through an interface. I would like to enforce the value of this new variable to be equal on both sides of the interface through defining a boundary condition.
I am wondering how should I make this happen. Please help me solve this problem.


Thank you.

Opaque January 8, 2020 16:20

Not sure what you are trying to enforce.

If they are connected by an interface, you must let equations satisfy themselves, i.e. fluxes are continuous.

Recall, the solution of the problem should be the same with or without the interface.

katty17 January 8, 2020 18:51

Hi Opaque,


Thanks for your attention,



Actually I want to enforce the value of the following equation to be equal on both sides of the interface.


C1*V*q+C2*dq/dy


where C1 and C2 are constants related to each domain (i.e., C1 for the domain#1 is not equal to that of the domain#2). V is the velocity and q is the new variable. y is the axis of coordinate system that is perpendicular to the interface.

Opaque January 8, 2020 21:48

I can only assume the equation for the AV contains similar constants C1; therefore, that is the condition implied by the

Conservative Interface Flux

option. Therefore, you have to do nothing since the software takes care of it.

For a better understanding of the readers here, if you state the equations solved in the interior for both sides of the interface, we can tell you what the software is doing.

Imposing anything else at the interface implies it is NOT a natural interface, and you are modeling something else, say a screen or thin material, etc. If that is the case, the mathematical formalism is even more important.

katty17 January 8, 2020 23:05

Thanks for your help.

I am trying to model mass transport in living tissues. The governing equations that are solved in both domains are momentum equation and the equation for the transport of the new variable.


The problem with the "Conservative Interface Flux" option is that I cannot introduce the coefficients C1 and C2 into it. Values of the C1 and C2 depends on the properties of the domain and in my case they don't have equal values on the left and right side of the interface.


If we assume that this interface is not a natural interface, can we introduce our new boundary conditions to the interface using the Junction box (I mean can we write a code in Fortran that calculates the value of the new variable by solving an iterative method and then let CFX to read the final values from the code)?

Opaque January 9, 2020 13:46

There is no problem with the properties on either side of the interface being different.

However, I would question the boundary condition if it does not match the transport equation. Without the mathematical formalism of what equations are being solved, it is very difficult to comment on how you are trying to close the model.

Keep in mind, the discretization of the control volume at the face touching the interface is trying to evaluate some flux formula, and that is what matters the most.

Flux_side 1 = < depends on the interior equations on side 1 ONLY >

Flux_side 2 = < depends on the interior equations on side 2 ONLY >

Then, at the interface you can do whatever you please to model, but keep in mind the software is currently doing

Flux_side 1 = Flux_side 2

That is Conservative Interface Flux option. Perhaps you want to write it

Flux_side 1 = Flux_side 2 + <Interface modeling term>

and deal with the extra term (if any at all).

If you do not follow the above, I would question the validity of the results, assuming the model converges at all since you may be violating the conservation principles altogether.

katty17 January 9, 2020 15:20

Thanks for your information.


Can you elaborate a little bit more on the mathematical formulation of the flux? I searched the ANSYS documentation but didn't find any.


In my problem, C2 is diffusivity and C1 is a constant that characterizes the permeability of its medium. Based on your information, I think the solver enforces the flux that is in the form of "V*q+dq/dy" to be equal on both sides of the interface. My question is how can I introduce C1 and C2 to this flux equation?



Attached is an image that indicates all boundary conditions used in my problem. As I said earlier, the governing equations are in-compressible Navier-Stokes and the transport equation for the variable q. Is this enough to get a picture of the mathematical formulation of my problem?


https://pasteboard.co/IPdoaVBg.png

Opaque January 9, 2020 15:43

The diagram helps a bit, but still incomplete. The boundary condition at external boundaries are clear.

However, not knowing EXACTLY what equations you are modeling in the interior, I do not understand where C1 comes from. If C1 is not part of the interior equations, it is not part of the physics in the domain at ALL.

When you say,
Quote:

I think the solver enforces the flux that is in the form of "V*q+dq/dy"
You seem to be missing density (say C1), and diffusivity (say C2) in your interpretation of the solved equations which may be the source of the question.

katty17 January 9, 2020 16:10

Attached shows the governing equations. C1 appears ac the coefficient in the source term of the momentum equation and also in the coefficient of the convection term in the transport equation. In these equations only V and q are variable. As it is shown the C1 is not equal to the density.

https://pasteboard.co/IPdFfTs.png

Opaque January 9, 2020 16:56

Great.. Now it is a lot clearer what is happening.

You are using the Brinkman-Forcheimer porous model plus some modification due to <q>. The equation for <q> contains the standard advection term plus another motion correction (C1)

Now, a few more questions:
1 - you had to make a selection between a fluid and porous domain, which one did you pick?
2 - The software requires a density of the fluid for the 3 equations shown, how did you rewrite your equation such that <q?>'s equation is conforming to the supported transport equation? Did you multiply by density on both sides?
3 - Similarly for the momentum equation, how are you managing Epsilon (I assume is the volumetric porosity)?

Opaque January 9, 2020 17:06

In addition, some other questions:

4 - have you been able to solve the problem in a single domain w/o interfaces?

5 - how did you manage to add the -C1 <V>.Grad(<q>) term? In particular the term must be discretized very carefully. If not discretized carefully, you may introduce a numerical source, and pollute the solution. What is the justification for such term? How does it look in conservative form before the continuity equation was substituted?

katty17 January 9, 2020 17:10

I am impressed!

Quote:

1 - you had to make a selection between a fluid and porous domain, which one did you pick?
I am trying to use full porous model ( I mean as a porous domain not a fluid domain).

Quote:

2 - The software requires a density of the fluid for the 3 equations shown, how did you rewrite your equation such that <q?>'s equation is conforming to the supported transport equation? Did you multiply by density on both sides?
Yes. I multiplied both sides by the the density.
Knowing that C2 is equal to the diffusivity (with negative sign) then the problem will be solved if we could modify the coefficient of V*q in the transferred flux at the interface. I am wondering if writing C2=ro-C3 (ro=density) and then introducing C3 as the source therm for the interface will help. I mean we can let CFX set the interface flux as ro*V*q-(diffusivity)*dq/dy and then add "-C3*V*q" to this equation using the "boundary source" tab. Do you think this is a valid solution?

Quote:

3 - Similarly for the momentum equation, how are you managing Epsilon (I assume is the volumetric porosity)?
Yes, it is volumetric porosity. Using a full porous domain it is one of the input parameters.

Quote:

4 - have you been able to solve the problem in a single domain w/o interfaces?
Not applicable because the fluids on both sides of the interface are not identical.

Quote:

5 - how did you manage to add the -C1 <V>.Grad(<q>) term? In particular the term must be discretized very carefully. If not discretized carefully, you may introduce a numerical source, and pollute the solution. What is the justification for such term? How does it look in conservative form before the continuity equation was substituted?
Using the source terms.





Thank you so much!

Opaque January 10, 2020 08:47

Thank you for the answer to several of the questions.

Just to be clear as we continue along,

1 - I assume you also multiplied the momentum equation by epsilon^2 such as it is conforming to the form used by the software, correct?

2 - the -C1 * V.Grad<q> is discretized as a source term? correct?

You should be fine, you do not need any modification of the interface boundary condition. The only time you need a modification of the flux used at a boundary if the equation term is written in divergence form. Yours is not for the C1 term, and why I asked about the discretization used for the term and where it came from.

My advice is to solve the single domain problem first (regardless of your long term goals). Verify each term is treated correctly, the solution converges w/o issues and the solution is as expected. Then, increase the complexity of the problem.

If the non-standard term had been written or discretized as

C1 * div (<V> * <q>)

Then, I would be looking into how the interface boundary treatment can be modified. There is a huge difference between the two forms, and their discretization details.

Hope the above helps,

katty17 January 10, 2020 11:28

Hi Opaque,


Thank you so much for your help and advice.



Quote:

1 - I assume you also multiplied the momentum equation by epsilon^2 such as it is conforming to the form used by the software, correct?
I am sorry, there is a typo in the momentum equation. The second mio (viscosty) like grad(P) has a superscript of "f". Both mio_f and grad(p)_f are already divided by the porosity. So multiplying them by porosity is enough to make the governing equations identical to those of ANSYS.


Quote:

2 - the -C1 * V.Grad<q> is discretized as a source term? correct?
Yes.


Simplifying the problem is a great idea. I'll give it a try. Thanks.


I would be very thankful if you could let me know how can I introduce porosity to the governing equations if I want to use a fluid domain rather than the porous one. How should I do this using the source term? When I look at the momentum equation of the full porous model (equation 1-281) the weird thing is that if we consider an isotropic porous domain that does not depend on the location then the solution of this equation would also be independent from the porosity because multiplying both sides of the equation 1-281 will totally remove the effect of porosity. Is this correct?
(Assuming that the BCs and initial conditions don't depend on the porosity)

Opaque January 10, 2020 11:43

Please have a look at the documentation for the fluid and porous domains

When solving porous media using fluid domains, you are solving for the

Superficial Velocity = Porosity * True Velocity

while using porous domains, you are solving for True Velocity.

Based on that the equations are the same, here the left hand side:

d (porosity * density * variable)
----------------------------------- + div ( density * porosity * True velocity * variable)
dt

or fluid domain

d (density * variable)
------------------------ + div ( density * Superficial velocity * variable)
dt

It is about understanding what you are solving for.

I still think you need to multiply by epsilon^2; otherwise, the equation does not make sense to me. For the porous domain formulation, the porosity must show as a multiplying factor in the following terms:
transient, advection, diffusion and pressure gradient.

Perhaps there is a confusion what <f> means. But, when integrating around a control volume the porosity accounts for the partial coverage of the fluid and the solid. That is, Area mesh face * porosity = Area the fluid is crossing and Volume mesh element * porosity = Volume the fluid occupies. If porosity is not in the right location, I have a hard time understanding its interpretation or the existence of typos or algebra mistakes.

katty17 January 11, 2020 14:51

Dear Opaque,

I need to investigate how the governing equations that I found in a paper were derived. Since they were so similar to the ANSYS's governing equations for the full porous model, I thought the "epsilon" has to be equal to the inverse of the volume porosity. If this is not the case, then I will definitely need to multiply both sides by epsilon squared. Thank you for bringing this point up. :o

So to use the fluid model as an alternative to the full porous model, I would need to multiply the grad(p) and the source term by the volume porosity and this is entirely done through modifying the source term. Am I correct?

Opaque January 13, 2020 09:54

Using a fluid domain approach, I would not modify the pressure term at all.

Just be certain the source terms are based on "superficial velocity" instead.

I would not even try to match the full porous model equations using the fluid domain. It will be hard and full of problems.

katty17 January 13, 2020 11:40

Dear Opaque,

Thanks a lot for your help.:)
I'll follow your suggestion.

Best,
Katty


All times are GMT -4. The time now is 10:46.