Metafor

ULiege - Aerospace & Mechanical Engineering

User Tools

Site Tools


doc:user:conditions:cond_init

Initial conditions

Initial conditions can be prescribed using the InitialConditionSet object, with a similar syntax to Prescribed Displacements:

Old Metafor Version < 3545

 icset = metafor.getInitialConditionSet()
 icset.define(target, field, ampl)
 icset.define(target, field, ampl, fctMultiChamps , fieldList)

New Metafor Version >= 3545

 icset = domain.getInitialConditionSet()
 icset.define(target, field, ampl)
 icset.define(target, field, ampl, fctMultiChamps , fieldList)

where

target GObject meshed geometric entity where the initial condition is prescribed
field Field1D nodal variable to be prescribed
field InternalField Gauss-point variable to be prescribed
ampl float initial value
fctMulti Advanced Function spatial dependence
fieldList Advanced list of dependency fields


Examples:
Initial temperature of 20°C for a volume:

 icset = metafor.getInitialConditionSet()
 icset.define(volumeset(1), Field1D(TO,AB), 20.0)

A space-dependent initial pressure at Gauss points:

 def pyFct(x, y):
    p = (2x+y)*1e4
    return p
 fctP = PythonMultiParameterFunction(pyFct, 2)
 
 icset = metafor.getInitialConditionSet()
 icset.define(sideset(1), IF_P, 1.0, fctP, FieldList(Field1D(TX,AB), Field1D(TY,AB)))
doc/user/conditions/cond_init.txt · Last modified: 2024/12/09 11:11 by vanhulle

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki