How to implement traction boundary condition at fluid-fluid boundary?

Numerical methods and mathematical models of Elmer
Post Reply
felixelmer
Posts: 9
Joined: 30 Nov 2020, 16:19
Antispam: Yes

How to implement traction boundary condition at fluid-fluid boundary?

Post by felixelmer »

Hi Elmer gurus:

I wish to implement the traction boundary conditions at the (curved, mobile) interface between two fluids. Each fluid has a N-S Solver. Two N-Solvers are used because later I'll add reaction and phase transition at the interface and make the physics in one fluid more complicated. For now, I just wish to code the sif correctly for the continuity of traction and velocity at the interface.

My mock code (attached below) doesn't work. For the second fluid, I have renamed the Equation and flow solution variable in the second solver, as:
Variable = FlowB [Velo:2 Pres:1]
My understanding is that "Pres 1, Pres 2, Pres 3" then represent the interfacial shear stress components, whereas these components in the first fluid are "Pressure 1, Pressure 2 and Pressure 3" (as described in the Solvers Manual). Also, I think that when referring to these components in the second fluid, I cannot write "FlowB 3 1, FlowB 3 2, FlowB 3 3".

With the code below, I get the following error:
ERROR:: ListParseStrToVars: Can't find independent variable:[pres 1] for dependent variable:[Pressure 1]
Thus ElmerSolver doesn't seem to pick up "Pres", as defined above.

Would you please kindly advice on how to code this problem, to match the traction components (which Elmer calls "Pressure [1,2,3]") across an interface?

Best wishes,
Felix

Code: Select all


!! Excerpt of the code:

Solver 1
  Equation = "Navier-Stokes"
  !! The Flow Solution Variable here is the normal one: Velocity 1, Velocity 2 and Pressure 
...
End

Solver 2
  Equation = "Navier-Stokes_fluidB"
  Procedure = "./FlowSolveExtra" "FlowSolver"         ! Extra copy of .so file in current directory
  Variable = FlowB [Velo:2 Pres:1]
...
End

Boundary Condition 4
  Name = "fluid-fluid boundary"
  Target Boundaries = 5
  Velo 1 = Variable Velocity 1
    Real lua "1.0 * tx[0]"
  Velo 2 = Variable Velocity 2
    Real lua "1.0 * tx[0]"
  Pressure 1 = Variable Pres 1
    Real lua "-1.0 * tx[0]"
  Pressure 2 = Variable Pres 2
    Real lua "-1.0 * tx[0]"
End

kevinarden
Posts: 2312
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: How to implement traction boundary condition at fluid-fluid boundary?

Post by kevinarden »

Perhaps it is because solver 1 goes first, and pres is defined in solver 2. So when solver 1 starts, pres is not defined.
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: How to implement traction boundary condition at fluid-fluid boundary?

Post by annier »

Hi,
1. Velocities and pressures are continuous variable over a computational domain. So, one navier stokes solver must work for two fluids (identified by two material properties blocks).

2. For fluids that change shapes, the interface can be tracked by solvers such as level-set solver (present in Elmer software).
(In OpenFOAM, volume of fluid can be utilized, and OpenFOAM can be coupled with Elmer using EOF-Library (https://eof-library.org/))
Another, way is tracking the interface between fluids with phase field method.




Yours Sincerely,
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
raback
Site Admin
Posts: 4828
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: How to implement traction boundary condition at fluid-fluid boundary?

Post by raback »

Hi,

Yes I would agree with annier that you should rather use one solver.

That being said you could probably couple two solvers (say A and B) using domain decomposition ideas (actually this is what you have done!). E.g. following Dirichlet-Neumann you displacement would go A->B and surface traction B->A. You need this kind of complementary BCs to achieve convergence of the weakly coupled system. It should be noted that this adds a layer of complexity with easily ~10 iterations.

On the other hand N-S solver can already have different material models in different sections. Hence I really do not see major motivation to split things up just because there happens to be two different fluids.

If you would insist on this DD I suggest using reaction forces. So say "Calculate Loads = True" and associate the reaction forces to be nodal forces for the 2nd solver. The velocities would go as you suggest.

Even this might not work since if the fluid is incompressible your BCs should be such that even during the iteration the net flux into the domain is zero.

-Peter
felixelmer
Posts: 9
Joined: 30 Nov 2020, 16:19
Antispam: Yes

Re: How to implement traction boundary condition at fluid-fluid boundary?

Post by felixelmer »

Hi kevinarden,

Thank you! Your advice has helped me to remove the error message so that ElmerSolver "knows" the variable now.

Best wishes,
Felix
felixelmer
Posts: 9
Joined: 30 Nov 2020, 16:19
Antispam: Yes

Re: How to implement traction boundary condition at fluid-fluid boundary?

Post by felixelmer »

Hi Anil,

Many thanks for your comment and advice!! If a few more trials with interface coupling (I see Peter's reply below) doesn't work for my problem, I shall explore the Level-Set method next (as suggested in your Item 2). In your suggested approach, would it be straightforward to deal with an interface across which velocities are discontinuous due to phase transition? The "phase transition" is one between Fluid 1 and Fluid 2 (not between fluid and solid) and occurs at a rate (and with a sign) governed by the difference in chemical concentration gradients across the interface. The chemistry experiences advection-diffusion and reaction in both fluids, and a further reaction (causing a sink for the chemistry) occurs at the interface.

In the very first version of the code with no such complexities, I did begin with one Solver and two Materials and solved the problem quickly. Then velocity and stresses are continuous, as you observed in your Item 1. When I started to tackle the phase transition and chemistry, I didn't see how one N-S Solver could still be used, and hence I've been exploring the "domain decomposition" approach, which led to my question about the traction BC.

Your thoughts regarding how to use Elmer to solve the sort of problem described above would be much appreciated!

Best wishes,
Felix
felixelmer
Posts: 9
Joined: 30 Nov 2020, 16:19
Antispam: Yes

Re: How to implement traction boundary condition at fluid-fluid boundary?

Post by felixelmer »

Hi Peter,

Many thanks for your very helpful reply, with insightful observations on domain decomposition and the direction of coupling velocities and force at the interface. Thanks also for your recommendation of using Nodal Loads. Elmer is new to me and I still know very little, and so I've been struggling with using Pressure [1,2,3] and use the Cauchy Stress tensor (computed from "ComputeDevStress") for implementing the interfacial BC... to no avail.

My current code is a mock-up. I have been using two solvers, thinking that the interactions to be added later to the problem will demand two solvers. I replied to Anil above to outline those interactions.

When I apply the Nodal Loads calculated for Fluid B to the Fluid A, am I correct that I should use the following sort of expression?
Flow Solution A 1 Load = Variable Flow Solution B Loads 1
Real lua "-tx[0]"
[ditto for component 2]
I read about this in Chapter 12 of the Solver Manual, but don't know if I've misunderstood the syntax/context.

Also, should this expression go in the Boundary Condition section, or the Body Force section?

I'm very grateful for your time and advice.

Best wishes,
Felix
Post Reply