Skip to content

Fluid2D

Eulerian 2D fluid

Target: SofaEulerianFluid

namespace: sofa::component::behaviormodel::eulerianfluid

parents:

  • BehaviorModel

Data

Name Description Default value
name object name unnamed
printLog if true, emits extra messages at runtime. 0
tags list of the subsets the objet belongs to
bbox this object bounding box
componentState The state of the component among (Dirty, Valid, Undefined, Loading, Invalid). Undefined
listening if true, handle the events, otherwise ignore the events 0
nx grid size along x axis 16
ny grid size along y axis 16
cellwidth width of each cell 1
height initial fluid height 5
dir initial fluid surface normal 0 1
tstart starting time for fluid source 0
tstop stopping time for fluid source 60
Name Description Destination type name
context Graph Node containing this object (or BaseContext::getDefault() if no graph is used) BaseContext
slaves Sub-objects used internally by this object BaseObject
master nullptr for regular objects, or master object for which this object is one sub-objects BaseObject

Examples

Fluid2D.scn

<Node dt="0.04" gravity="0 -10 0">
    <VisualStyle displayFlags="showForceFields showCollisionModels showMappings" />
    <RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [VisualStyle] -->
    <RequiredPlugin name="SofaEulerianFluid"/> <!-- Needed to use components [Fluid2D] -->

    <Fluid2D nx="32" ny="32" tstart="30" tstop="60" height="15.5" dir="1 0" />
</Node>
def createScene(root_node):

   node = root_node.addChild('node', dt="0.04", gravity="0 -10 0")

   node.addObject('VisualStyle', displayFlags="showForceFields showCollisionModels showMappings")
   node.addObject('RequiredPlugin', name="Sofa.Component.Visual")
   node.addObject('RequiredPlugin', name="SofaEulerianFluid")
   node.addObject('Fluid2D', nx="32", ny="32", tstart="30", tstop="60", height="15.5", dir="1 0")