Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ryujin simulation with multiple inlets (Question) #176

Open
rl3418 opened this issue Sep 23, 2024 · 4 comments
Open

Ryujin simulation with multiple inlets (Question) #176

rl3418 opened this issue Sep 23, 2024 · 4 comments
Labels

Comments

@rl3418
Copy link

rl3418 commented Sep 23, 2024

test.txt
Hi,

I am trying to implement a ryujin simulation with two inlets. The file attached is the geometry I defined using Gmsh. I want to have two inlets at the top injecting helium at different temperatures. Not exactly sure how to configure the initialvalues in the prm file. It only takes one direction and a single position for the inlet.

@rl3418 rl3418 changed the title Ryujin simulation with multiple inlets Ryujin simulation with multiple inlets (Question) Sep 23, 2024
@ejtovar
Copy link
Contributor

ejtovar commented Sep 23, 2024

@rl3418 Do you mind posting the geometry figure? I believe you can use the "function" initial state for custom configurations. See the default prm file with description for more info.

@rl3418
Copy link
Author

rl3418 commented Sep 27, 2024

image
Sorry for the late reply, this is how the geometry looks like. I have got two inlets on the top. Is there an example benchmark script that uses the 'function' initial state?

@ejtovar
Copy link
Contributor

ejtovar commented Sep 27, 2024

@rl3418 I don't believe there is an example for the Euler Equations. Here is a simple example you can modify:

subsection function
    set density expression    = (x > 0.) ? 1.4 : 1.0
    set pressure expression   = 1.0
    set velocity x expression = 0.0
    set velocity y expression = (x > 0.) ? -1.0 : -5.0
  end

Note the use of the ternary operator which can be useful for your test case.

@tamiko
Copy link
Member

tamiko commented Sep 30, 2024

@rl3418 This is not terribly well explained - we should really update our documentation in this regard: The parameter section for initial values looks as follwos::

subsection E - InitialValues
  set configuration = function

  set direction     = 1, 0
  set position      = 0, 0

  subsection function
    ...
  end
end

Here, we use the following convention: The initial configuration should be centered in the origin (0,0) and oriented in positive x-direction (1,0). We then use the direction and position arguments to apply a global Galilean transform: The initial configuration is moved so that the origin rests on the position coordinate and the initial configuration is rotated so that the x-direction is facing in direction (we apply a rotation to the velocity/momentum fields).

So that means you can do the following:

  • add a function subsection with something like (x > 0.) ? <value for interior> : ((y > 0) ? <value for right inlet> : <value for left inlet>)
  • now apply a Galilean transform so that position is set to the center point between the two upper boundaries of the inlets, and set direction to 0, -1 (facing down).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants