[FEM] rewrite initial velocity constraint

- same as #8963 but for initial velocity

- add an example file that demonstrates the influence of the initial velocity
- some fine-tuning for the existing flow example
This commit is contained in:
Uwe
2023-03-20 04:28:45 +01:00
parent b496a41cd1
commit 866ea2551d
9 changed files with 623 additions and 175 deletions

View File

@@ -193,14 +193,23 @@ class Flowwriter:
def _outputInitialVelocity(self, obj, name):
# flow only makes sense for fluid material
if self.write.isBodyMaterialFluid(name):
if obj.VelocityXEnabled:
velocity = self.write.getFromUi(obj.VelocityX, "m/s", "L/T")
if not obj.VelocityXUnspecified:
if not obj.VelocityXHasFormula:
velocity = float(obj.VelocityX.getValueAs("m/s"))
else:
velocity = obj.VelocityXFormula
self.write.initial(name, "Velocity 1", velocity)
if obj.VelocityYEnabled:
velocity = self.write.getFromUi(obj.VelocityY, "m/s", "L/T")
if not obj.VelocityYUnspecified:
if not obj.VelocityYHasFormula:
velocity = float(obj.VelocityY.getValueAs("m/s"))
else:
velocity = obj.VelocityYFormula
self.write.initial(name, "Velocity 2", velocity)
if obj.VelocityZEnabled:
velocity = self.write.getFromUi(obj.VelocityZ, "m/s", "L/T")
if not obj.VelocityZUnspecified:
if not obj.VelocityZHasFormula:
velocity = float(obj.VelocityZ.getValueAs("m/s"))
else:
velocity = obj.VelocityZFormula
self.write.initial(name, "Velocity 3", velocity)
def handleFlowInitialVelocity(self, bodies):