- center0.5 0.5 0The center of the bubble.
Default:0.5 0.5 0
C++ Type:libMesh::VectorValue<double>
Unit:(no unit assumed)
Controllable:No
Description:The center of the bubble.
- epsilon0.01The interface thickness.
Default:0.01
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:The interface thickness.
- radius0.15The radius of the bubble.
Default:0.15
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:The radius of the bubble.
LevelSetOlssonBubble
Olsson and Kreiss (2005) define a level set function () that differs from the traditional signed distance function. They define a level set function ranging from 0 to 1 with a defined thickness (), which is a commonly referred to as a smeared Heaviside function ():
Typically, the interface of the level set function is defined by the 0.5 contour and the interface or boundary layer is defined between 0 and 1.
For example, the following code creates a "bubble" in the lower left corner in a domain ranging from 0 to 1 in the x- and y-direction, as shown in the figure.
[Functions]
[./bubble_func]
type = LevelSetOlssonBubble
center = '0.25 0.25 0'
radius = 0.15
[../]
[]
(modules/level_set/test/tests/functions/olsson_bubble/olsson_bubble.i)Input Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Unit:(no unit assumed)
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Unit:(no unit assumed)
Controllable:No
Description:Set the enabled status of the MooseObject.
Advanced Parameters
Input Files
- (modules/level_set/examples/vortex/vortex_supg.i)
- (modules/level_set/test/tests/functions/olsson_bubble/olsson_bubble.i)
- (modules/level_set/examples/rotating_circle/circle_rotate_supg.i)
- (modules/level_set/examples/vortex/vortex.i)
- (modules/level_set/examples/circle/circle_16.i)
- (modules/level_set/examples/vortex/vortex_reinit.i)
- (modules/level_set/examples/rotating_circle/circle_rotate.i)
- (modules/level_set/test/tests/reinitialization/parent.i)
- (modules/level_set/examples/rotating_circle/circle_rotate_parent.i)
- (modules/level_set/test/tests/functions/olsson_bubble/olsson_bubble_adjac.i)
References
- Elin Olsson and Gunilla Kreiss.
A conservative level set method for two phase flow.
Journal of computational physics, 210(1):225–246, 2005.
URL: http://dx.doi.org/10.1016/j.jcp.2005.04.007.[BibTeX]
@article{olsson2005conservative, author = "Olsson, Elin and Kreiss, Gunilla", title = "A conservative level set method for two phase flow", journal = "Journal of computational physics", volume = "210", number = "1", pages = "225--246", year = "2005", publisher = "Elsevier", url = "http://dx.doi.org/10.1016/j.jcp.2005.04.007" }
(modules/level_set/test/tests/functions/olsson_bubble/olsson_bubble.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
[]
[Adaptivity]
initial_marker = marker
initial_steps = 2
max_h_level = 2
[./Markers]
[./marker]
type = BoxMarker
bottom_left = '0 0 0'
top_right = '0.5 0.5 0'
inside = REFINE
outside = DO_NOTHING
[../]
[../]
[]
[AuxVariables]
[./bubble]
[../]
[]
[AuxKernels]
[./bubble_aux]
type = FunctionAux
variable = bubble
function = bubble_func
execute_on = initial
[../]
[]
[Functions]
[./bubble_func]
type = LevelSetOlssonBubble
center = '0.25 0.25 0'
radius = 0.15
[../]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
execute_on = 'TIMESTEP_END'
exodus = true
[]
(modules/level_set/examples/vortex/vortex_supg.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmax = 1
ymax = 1
nx = 16
ny = 16
uniform_refine = 2
elem_type = QUAD9
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[AuxKernels]
[./vec]
type = VectorFunctionAux
variable = velocity
function = velocity_func
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
[Variables]
[./phi]
family = LAGRANGE
order = FIRST
[../]
[]
[Functions]
[./phi_exact]
type = LevelSetOlssonBubble
epsilon = 0.01184
center = '0.5 0.75 0'
radius = 0.15
[../]
[./velocity_func]
type = LevelSetOlssonVortex
reverse_time = 2
[../]
[]
[ICs]
[./phi_ic]
type = FunctionIC
function = phi_exact
variable = phi
[../]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./advection]
type = LevelSetAdvection
velocity = velocity
variable = phi
[../]
[./advection_supg]
type = LevelSetAdvectionSUPG
velocity = velocity
variable = phi
[../]
[./time_supg]
type = LevelSetTimeDerivativeSUPG
velocity = velocity
variable = phi
[../]
[]
[Postprocessors]
[./area]
type = LevelSetVolume
threshold = 0.5
variable = phi
location = outside
execute_on = 'initial timestep_end'
[../]
[./cfl]
type = LevelSetCFLCondition
velocity = velocity
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
start_time = 0
end_time = 2
scheme = crank-nicolson
petsc_options_iname = '-pc_type -pc_sub_type'
petsc_options_value = 'asm ilu'
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 0.8
[../]
[]
[Outputs]
csv = true
exodus = true
[]
(modules/level_set/test/tests/functions/olsson_bubble/olsson_bubble.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
[]
[Adaptivity]
initial_marker = marker
initial_steps = 2
max_h_level = 2
[./Markers]
[./marker]
type = BoxMarker
bottom_left = '0 0 0'
top_right = '0.5 0.5 0'
inside = REFINE
outside = DO_NOTHING
[../]
[../]
[]
[AuxVariables]
[./bubble]
[../]
[]
[AuxKernels]
[./bubble_aux]
type = FunctionAux
variable = bubble
function = bubble_func
execute_on = initial
[../]
[]
[Functions]
[./bubble_func]
type = LevelSetOlssonBubble
center = '0.25 0.25 0'
radius = 0.15
[../]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
execute_on = 'TIMESTEP_END'
exodus = true
[]
(modules/level_set/examples/rotating_circle/circle_rotate_supg.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 32
ny = 32
uniform_refine = 2
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[Variables]
[./phi]
[../]
[]
[Functions]
[./phi_exact]
type = LevelSetOlssonBubble
epsilon = 0.03
center = '0 0.5 0'
radius = 0.15
[../]
[./velocity_func]
type = ParsedVectorFunction
expression_x = '4*y'
expression_y = '-4*x'
[../]
[]
[ICs]
[./phi_ic]
type = FunctionIC
function = phi_exact
variable = phi
[../]
[./vel_ic]
type = VectorFunctionIC
variable = velocity
function = velocity_func
[]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./advection]
type = LevelSetAdvection
velocity = velocity
variable = phi
[../]
[./advection_supg]
type = LevelSetAdvectionSUPG
velocity = velocity
variable = phi
[../]
[./time_supg]
type = LevelSetTimeDerivativeSUPG
velocity = velocity
variable = phi
[../]
[]
[Postprocessors]
[./area]
type = LevelSetVolume
threshold = 0.5
variable = phi
location = outside
execute_on = 'initial timestep_end'
[../]
[./cfl]
type = LevelSetCFLCondition
velocity = velocity
execute_on = 'initial'
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
start_time = 0
end_time = 1.570796
scheme = crank-nicolson
petsc_options_iname = '-pc_type -pc_sub_type'
petsc_options_value = 'asm ilu'
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 0.8
[../]
[]
[Outputs]
csv = true
exodus = true
[]
(modules/level_set/examples/vortex/vortex.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmax = 1
ymax = 1
nx = 16
ny = 16
uniform_refine = 2
elem_type = QUAD9
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[AuxKernels]
[./vec]
type = VectorFunctionAux
variable = velocity
function = velocity_func
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
[Variables]
[./phi]
family = LAGRANGE
order = FIRST
[../]
[]
[Functions]
[./phi_exact]
type = LevelSetOlssonBubble
epsilon = 0.01184
center = '0.5 0.75 0'
radius = 0.15
[../]
[./velocity_func]
type = LevelSetOlssonVortex
reverse_time = 2
[../]
[]
[ICs]
[./phi_ic]
type = FunctionIC
function = phi_exact
variable = phi
[../]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./advection]
type = LevelSetAdvection
velocity = velocity
variable = phi
[../]
[]
[Postprocessors]
[./area]
type = LevelSetVolume
threshold = 0.5
variable = phi
location = outside
execute_on = 'initial timestep_end'
[../]
[./cfl]
type = LevelSetCFLCondition
velocity = velocity
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
start_time = 0
end_time = 2
scheme = crank-nicolson
petsc_options_iname = '-pc_type -pc_sub_type'
petsc_options_value = 'asm ilu'
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 0.8
[../]
[]
[Outputs]
csv = true
exodus = true
[]
(modules/level_set/examples/circle/circle_16.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 16
ny = 16
[]
[Variables]
[./phi]
[../]
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[ICs]
[./phi_ic]
type = FunctionIC
function = phi_exact
variable = phi
[../]
[./vel_ic]
type = VectorFunctionIC
variable = velocity
function = velocity_func
[]
[]
[Functions]
[./phi_exact]
type = LevelSetOlssonBubble
epsilon = 0.05
center = '0.5 0.5 0'
radius = 0.15
[../]
[./velocity_func]
type = ParsedVectorFunction
expression_x = '3'
expression_y = '3'
[../]
[]
[BCs]
[./Periodic]
[./all]
variable = phi
auto_direction = 'x y'
[../]
[../]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./advection]
type = LevelSetAdvection
velocity = velocity
variable = phi
[../]
[]
[Postprocessors]
[./cfl]
type = LevelSetCFLCondition
velocity = velocity
execute_on = 'initial'
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
start_time = 0
end_time = 1
scheme = crank-nicolson
petsc_options_iname = '-pc_type -pc_sub_type'
petsc_options_value = 'asm ilu'
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 0.8
[../]
[]
[Outputs]
csv = true
exodus = true
[]
(modules/level_set/examples/vortex/vortex_reinit.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmax = 1
ymax = 1
nx = 16
ny = 16
uniform_refine = 2
elem_type = QUAD9
second_order = true
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[AuxKernels]
[./vec]
type = VectorFunctionAux
variable = velocity
function = velocity_func
execute_on = 'INITIAL TIMESTEP_END'
[../]
[]
[Variables]
[phi]
family = LAGRANGE
[]
[]
[Functions]
[phi_exact]
type = LevelSetOlssonBubble
epsilon = 0.03
center = '0.5 0.75 0'
radius = 0.15
[]
[./velocity_func]
type = LevelSetOlssonVortex
reverse_time = 2
[../]
[]
[ICs]
[phi_ic]
type = FunctionIC
function = phi_exact
variable = phi
[]
[]
[Kernels]
[time]
type = TimeDerivative
variable = phi
[]
[advection]
type = LevelSetAdvection
velocity = velocity
variable = phi
[]
[advection_supg]
type = LevelSetAdvectionSUPG
velocity = velocity
variable = phi
[]
[time_supg]
type = LevelSetTimeDerivativeSUPG
velocity = velocity
variable = phi
[]
[]
[Postprocessors]
[area]
type = LevelSetVolume
threshold = 0.5
variable = phi
location = outside
execute_on = 'initial timestep_end'
[]
[cfl]
type = LevelSetCFLCondition
velocity = velocity
execute_on = 'initial timestep_end'
[]
[]
[Problem]
type = LevelSetProblem
[]
[Preconditioning/smp]
type = SMP
full = true
[]
[Executioner]
type = Transient
solve_type = NEWTON
start_time = 0
end_time = 2
scheme = crank-nicolson
[TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 0.8
[]
[]
[MultiApps]
[reinit]
type = LevelSetReinitializationMultiApp
input_files = 'vortex_reinit_sub.i'
execute_on = TIMESTEP_END
[]
[]
[Transfers]
[to_sub]
type = MultiAppCopyTransfer
source_variable = phi
variable = phi
to_multi_app = reinit
execute_on = 'timestep_end'
[]
[to_sub_init]
type = MultiAppCopyTransfer
source_variable = phi
variable = phi_0
to_multi_app = reinit
execute_on = 'timestep_end'
[]
[from_sub]
type = MultiAppCopyTransfer
source_variable = phi
variable = phi
from_multi_app = reinit
execute_on = 'timestep_end'
[]
[]
[Outputs]
csv = true
exodus = true
[]
(modules/level_set/examples/rotating_circle/circle_rotate.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 32
ny = 32
uniform_refine = 2
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[Variables]
[./phi]
[../]
[]
[Functions]
[./phi_exact]
type = LevelSetOlssonBubble
epsilon = 0.03
center = '0 0.5 0'
radius = 0.15
[../]
[./velocity_func]
type = ParsedVectorFunction
expression_x = '4*y'
expression_y = '-4*x'
[../]
[]
[ICs]
[./phi_ic]
type = FunctionIC
function = phi_exact
variable = phi
[../]
[./vel_ic]
type = VectorFunctionIC
variable = velocity
function = velocity_func
[]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./advection]
type = LevelSetAdvection
velocity = velocity
variable = phi
[../]
[]
[Postprocessors]
[./area]
type = LevelSetVolume
threshold = 0.5
variable = phi
location = outside
execute_on = 'initial timestep_end'
[../]
[./cfl]
type = LevelSetCFLCondition
velocity = velocity
execute_on = 'initial' #timestep_end'
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
start_time = 0
end_time = 1.570796
scheme = crank-nicolson
petsc_options_iname = '-pc_type -pc_sub_type'
petsc_options_value = 'asm ilu'
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 0.8
[../]
[]
[Outputs]
csv = true
exodus = true
[]
(modules/level_set/test/tests/reinitialization/parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 8
ny = 8
uniform_refine = 3 #1/64
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[Variables]
[./phi]
[../]
[]
[Functions]
[./phi_exact]
type = LevelSetOlssonBubble
epsilon = 0.05
center = '0.5 0.5 0'
radius = 0.15
[../]
[./velocity_func]
type = ParsedVectorFunction
expression_x = '1'
expression_y = '1'
[../]
[]
[BCs]
[./Periodic]
[./all]
variable = phi
auto_direction = 'x y'
[../]
[../]
[]
[ICs]
[./phi_ic]
type = FunctionIC
function = phi_exact
variable = phi
[../]
[./vel_ic]
type = VectorFunctionIC
variable = velocity
function = velocity_func
[]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./advection]
type = LevelSetAdvection
velocity = velocity
variable = phi
[../]
[]
[Postprocessors]
[./area]
type = LevelSetVolume
threshold = 0.5
variable = phi
location = outside
execute_on = 'initial timestep_end'
[../]
[./cfl]
type = LevelSetCFLCondition
velocity = velocity
execute_on = 'initial'
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
start_time = 0
end_time = 1
nl_rel_tol = 1e-12
scheme = crank-nicolson
petsc_options_iname = '-pc_type -pc_sub_type'
petsc_options_value = 'asm ilu'
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 1
[../]
[]
[MultiApps]
[./reinit]
type = LevelSetReinitializationMultiApp
input_files = 'reinit.i'
execute_on = 'timestep_end'
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
variable = phi
source_variable = phi
to_multi_app = reinit
execute_on = 'timestep_end'
[../]
[./to_sub_init]
type = MultiAppCopyTransfer
variable = phi_0
source_variable = phi
to_multi_app = reinit
execute_on = 'timestep_end'
[../]
[./from_sub]
type = MultiAppCopyTransfer
variable = phi
source_variable = phi
from_multi_app = reinit
execute_on = timestep_end
[../]
[]
[Outputs]
exodus = true
[]
(modules/level_set/examples/rotating_circle/circle_rotate_parent.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 32
ny = 32
uniform_refine = 2
[]
[AuxVariables]
[./velocity]
family = LAGRANGE_VEC
[../]
[]
[Variables]
[./phi]
[../]
[]
[BCs]
[./all]
type = DirichletBC
variable = phi
boundary = 'top bottom left right'
value = 0
[../]
[]
[Functions]
[./phi_exact]
type = LevelSetOlssonBubble
epsilon = 0.03
center = '0 0.5 0'
radius = 0.15
[../]
[./velocity_func]
type = ParsedVectorFunction
expression_x = '4*y'
expression_y = '-4*x'
[../]
[]
[ICs]
[./phi_ic]
type = FunctionIC
function = phi_exact
variable = phi
[../]
[./vel_ic]
type = VectorFunctionIC
variable = velocity
function = velocity_func
[]
[]
[Kernels]
[./time]
type = TimeDerivative
variable = phi
[../]
[./advection]
type = LevelSetAdvection
velocity = velocity
variable = phi
[../]
[]
[Postprocessors]
[./area]
type = LevelSetVolume
threshold = 0.5
variable = phi
location = outside
execute_on = 'initial timestep_end'
[../]
[./cfl]
type = LevelSetCFLCondition
velocity = velocity
execute_on = 'initial timestep_end'
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
start_time = 0
end_time = 1.570796
scheme = crank-nicolson
petsc_options_iname = '-pc_type -pc_sub_type'
petsc_options_value = 'asm ilu'
[./TimeStepper]
type = PostprocessorDT
postprocessor = cfl
scale = 0.8
[../]
[]
[MultiApps]
[./reinit]
type = LevelSetReinitializationMultiApp
input_files = 'circle_rotate_sub.i'
execute_on = 'timestep_end'
[../]
[]
[Transfers]
[./to_sub]
type = MultiAppCopyTransfer
source_variable = phi
variable = phi
to_multi_app = reinit
execute_on = 'timestep_end'
[../]
[./to_sub_init]
type = MultiAppCopyTransfer
source_variable = phi
variable = phi_0
to_multi_app = reinit
execute_on = 'timestep_end'
[../]
[./from_sub]
type = MultiAppCopyTransfer
source_variable = phi
variable = phi
from_multi_app = reinit
execute_on = 'timestep_end'
[../]
[]
[Outputs]
csv = true
exodus = true
[]
(modules/level_set/test/tests/functions/olsson_bubble/olsson_bubble_adjac.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
displacements = 'disp_x disp_y'
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[bubble]
[]
[disp_x]
[]
[disp_y]
[]
[]
[Kernels]
[bubble]
type = ADBodyForce
variable = bubble
function = bubble_func
use_displaced_mesh = true
[]
[dt]
type = ADTimeDerivative
variable = bubble
[]
[]
[Functions]
[bubble_func]
type = LevelSetOlssonBubble
center = '0.5 0.5 0'
radius = 0.4
epsilon = 0.05
[]
[]
[Executioner]
solve_type = NEWTON
type = Transient
num_steps = 1
[]
[Outputs]
exodus = true
[]