Exported Variables

Numerical methods and mathematical models of Elmer
Post Reply
wmiller
Posts: 9
Joined: 09 May 2017, 18:05
Antispam: Yes

Exported Variables

Post by wmiller » 18 Oct 2017, 16:41

I am going to solve separate convection for melt and gas (using two set of Variables wit boundary conditions).
Thus there are two Navier Stokes solvers (Navier Stokes Melt and Navier Stokes Gas) actining in two different bodies.

In addition the thermal field should be solved in the entire domain, i.e. in all bodies.
Thus I define Temperature Convection Field = Flow Solution [velocity:3 pressure], where Flow Solution is now a unique field for all bodies.

In order to have the right advection term in the Heat Solver the Flow Solution variables should be set in the right manner.

How should the "Exported Variable" be defined as the are local for solver (only the bodies, where the solver will act).

For one solver the procedure of defining "Exported Variable" and Update works fine but how to do for two solvers acting in different
bodies ?

Wolfram

raback
Site Admin
Posts: 3321
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Exported Variables

Post by raback » 22 Oct 2017, 23:09

Hi Wolfram

I'm not totally positive that you can have two different instances of FlowSolver. Probably, but some lagacy solvers may have some limitations since our philosophy for multiphysics was not as settled then.

At least you need to have different values for Equation and Variable. Also if you have keywords that could be conflicting you might use namespace. e.g.

Code: Select all

Solver 1
  Equation = "FlowA"
  Variable = FlowA[VeloA:3 PresA]
  ..

Solver 2
  Equation = "FlowB"
  Variable = FlowB[VeloB:3 PresB]
  ...

Boundary Condition 1
  Name = Inflow
  VeloA 1 = Variable "Coordinate 2"
    Real MATC "tx(1-tx)
  ...
I don't see where "Exported Variable" here would be very helpful.

Also, I don't necessarily see why you need to have two instances for the same equation. Why can't you solve both at the same time? The natural reason would be different timescales. The one part having a stationary solution and the other a wildly transient one.

-Peter

wmiller
Posts: 9
Joined: 09 May 2017, 18:05
Antispam: Yes

Re: Exported Variables

Post by wmiller » 23 Oct 2017, 11:03

Hi Peter

thank's for your reply.
Indeed, the way you describe it is exactly how I realize the two solvers.

Just, for the background. In Czochralski growth we have melt and gas flow. This want to separate as for gas flow it is not useful to include crystal and crucible rotation but for melt it is important. For this reason a use two different Flow solvers with two different boundary conditions. (At the melt/gas interface it is Marangoni flow for melt but non-slip for gas).
However, solving the heat equation in the entire furnace I want to solve one heat equation. Thus I need one velocity field containing melt velocity and gas velocity.
As the problem is axi-symmetric the azimuthal velocity does not play any role and can be set to zero for the advection equation.

For melt convection I can define

Code: Select all

Solver 9
 Equation = "Navier-Stokes-Melt"
 Procedure = "FlowSolve" "FlowSolver"
 Stabilize = True
 Variable = Flow Solution Melt [Velocitymelt:3 Pressuremelt:1]

!!! Update all exported variables

  Update Exported Variables = Logical True

  Exported Variable 1 =  Flow Solution [Velocity:3 Pressure:1]
  Exported Variable 2 = -dofs 3 Velocityout

where in the heat solver the advection term is set by

Code: Select all

 Solver 3
  Equation = Heat Equation 

  Procedure = "HeatSolve" "HeatSolver"
  Variable = -dofs 1 Temperature

  Temperature Convection Field = Flow Solution [Velocity:3 Pressure:1]
The velocities are set by a body force in the melt domain:

Code: Select all

   Velocity 1 = Variable Velocitymelt 1
     Real MATC "tx"
   Velocity 2 = Variable Velocitymelt 2
     Real MATC "tx"
   Velocity 3 = Real 0
   Pressure   = Variable Pressuremelt
     Real MATC "tx"

The question is how to do the same for the gas velocity.

Same kind of Body Force in the gas domain does not work because for the same export variable a segmentation error occur.

adamo
Posts: 19
Joined: 02 Feb 2017, 00:19
Antispam: Yes

Re: Exported Variables

Post by adamo » 01 Nov 2017, 18:38

Dear Peter and Wolfram,

did you manage to implement the solution below? I tried today and keep getting
Model Input: Unlisted keyword: [VeloA 1] in section: [boundary condition 1]

Thanks a lot

Adam
raback wrote:Hi Wolfram

I'm not totally positive that you can have two different instances of FlowSolver. Probably, but some lagacy solvers may have some limitations since our philosophy for multiphysics was not as settled then.

At least you need to have different values for Equation and Variable. Also if you have keywords that could be conflicting you might use namespace. e.g.

Code: Select all

Solver 1
  Equation = "FlowA"
  Variable = FlowA[VeloA:3 PresA]
  ..

Solver 2
  Equation = "FlowB"
  Variable = FlowB[VeloB:3 PresB]
  ...

Boundary Condition 1
  Name = Inflow
  VeloA 1 = Variable "Coordinate 2"
    Real MATC "tx(1-tx)
  ...
I don't see where "Exported Variable" here would be very helpful.

Also, I don't necessarily see why you need to have two instances for the same equation. Why can't you solve both at the same time? The natural reason would be different timescales. The one part having a stationary solution and the other a wildly transient one.

-Peter

mzenker
Posts: 1806
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Exported Variables

Post by mzenker » 03 Nov 2017, 11:29

Hi,

AFAIK the "unlisted keyword" message is just a warning stating that the keyword doesn't figure in the SOLVER.KEYWORDS file in the share/elmersolver/lib directory, meaning that you have to indicate the keyword type (e.g. "Real"). So if there is no error or misfunction you should not need to worry about that.

HTH,
Matthias

adamo
Posts: 19
Joined: 02 Feb 2017, 00:19
Antispam: Yes

Re: Exported Variables

Post by adamo » 03 Nov 2017, 20:00

Thanks a lot, Matthias, you were absolutely right. The problem was that ElmerSolver manual tells me to write

Code: Select all

Variable = Flow [VeloB:3 PresB]
while it should go

Code: Select all

Variable = Flow Solution [VeloB:3 PresB]
All the best

Adam

Post Reply