FEM: FluidSection: Unit test
This commit is contained in:
@@ -190,6 +190,12 @@ SET(FemTests_SRCS
|
||||
test_files/ccx/spine_thermomech.frd
|
||||
test_files/ccx/spine_thermomech_expected_values
|
||||
test_files/ccx/spine_thermomech.fcstd
|
||||
test_files/ccx/Flow1D_mesh.py
|
||||
test_files/ccx/Flow1D_thermomech.inp
|
||||
test_files/ccx/Flow1D_thermomech.dat
|
||||
test_files/ccx/Flow1D_thermomech.frd
|
||||
test_files/ccx/Flow1D_thermomech_expected_values
|
||||
test_files/ccx/Flow1D_thermomech.fcstd
|
||||
)
|
||||
|
||||
SET(FemBase_SRCS
|
||||
|
||||
@@ -154,6 +154,12 @@ INSTALL(
|
||||
test_files/ccx/spine_thermomech.frd
|
||||
test_files/ccx/spine_thermomech_expected_values
|
||||
test_files/ccx/spine_thermomech.fcstd
|
||||
test_files/ccx/Flow1D_mesh.py
|
||||
test_files/ccx/Flow1D_thermomech.inp
|
||||
test_files/ccx/Flow1D_thermomech.dat
|
||||
test_files/ccx/Flow1D_thermomech.frd
|
||||
test_files/ccx/Flow1D_thermomech_expected_values
|
||||
test_files/ccx/Flow1D_thermomech.fcstd
|
||||
DESTINATION
|
||||
Mod/Fem/test_files/ccx
|
||||
)
|
||||
|
||||
@@ -58,6 +58,11 @@ thermomech_save_fc_file = thermomech_analysis_dir + '/' + thermomech_base_name +
|
||||
thermomech_analysis_inp_file = test_file_dir + '/' + thermomech_base_name + '.inp'
|
||||
thermomech_expected_values = test_file_dir + "/spine_thermomech_expected_values"
|
||||
|
||||
Flow1D_thermomech_base_name = 'Flow1D_thermomech'
|
||||
Flow1D_thermomech_analysis_dir = temp_dir + '/FEM_Flow1D_thermomech'
|
||||
Flow1D_thermomech_save_fc_file = Flow1D_thermomech_analysis_dir + '/' + Flow1D_thermomech_base_name + '.fcstd'
|
||||
Flow1D_thermomech_analysis_inp_file = test_file_dir + '/' + Flow1D_thermomech_base_name + '.inp'
|
||||
Flow1D_thermomech_expected_values = test_file_dir + "/Flow1D_thermomech_expected_values"
|
||||
|
||||
class FemTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
@@ -405,6 +410,277 @@ class FemCcxAnalysisTest(unittest.TestCase):
|
||||
|
||||
fcc_print('--------------- End of FEM tests thermomech analysis ---------------')
|
||||
|
||||
def test_Flow1D_thermomech_analysis(self):
|
||||
fcc_print('--------------- Start of 1D Flow FEM tests ---------------')
|
||||
import Draft
|
||||
p1 = FreeCAD.Vector(0, 1.11022302462516e-14, 50)
|
||||
p2 = FreeCAD.Vector(0, -1.11022302462516e-14, -50)
|
||||
p3 = FreeCAD.Vector(0, -9.54791801177633e-13, -4300)
|
||||
p4 = FreeCAD.Vector(4950, -9.54791801177633e-13, -4300)
|
||||
p5 = FreeCAD.Vector(5000, -9.54791801177633e-13, -4300)
|
||||
p6 = FreeCAD.Vector(8535.53, -1.73983716322823e-12, -7835.53)
|
||||
p7 = FreeCAD.Vector(8569.88, -1.74768644001233e-12, -7870.88)
|
||||
p8 = FreeCAD.Vector(12105.41, -2.53273180206292e-12, -11406.41)
|
||||
p9 = FreeCAD.Vector(12140.76, -2.54058107884702e-12, -11441.76)
|
||||
p10 = FreeCAD.Vector(13908.53, -2.93310487009534e-12, -13209.53)
|
||||
p11 = FreeCAD.Vector(13943.88, -2.94095414687944e-12, -13244.88)
|
||||
p12 = FreeCAD.Vector(15046.97, -3.1858893301262e-12, -14347.97)
|
||||
p13 = FreeCAD.Vector(15046.97, -1.764803858606e-12, -7947.97)
|
||||
p14 = FreeCAD.Vector(15046.97, -1.7425993981135e-12, -7847.97)
|
||||
p15 = FreeCAD.Vector(0, 0, 0)
|
||||
p16 = FreeCAD.Vector(0, -4.82947015711942e-13, -2175)
|
||||
p17 = FreeCAD.Vector(2475, -9.54791801177633e-13, -4300)
|
||||
p18 = FreeCAD.Vector(4975, -9.54791801177633e-13, -4300)
|
||||
p19 = FreeCAD.Vector(6767.765, -1.34731448220293e-12, -6067.765)
|
||||
p20 = FreeCAD.Vector(8552.705, -1.74376180162028e-12, -7853.205)
|
||||
p21 = FreeCAD.Vector(10337.645, -2.14020912103763e-12, -9638.645)
|
||||
p22 = FreeCAD.Vector(12123.085, -2.53665644045497e-12, -11424.085)
|
||||
p23 = FreeCAD.Vector(13024.645, -2.73684297447118e-12, -12325.645)
|
||||
p24 = FreeCAD.Vector(13926.205, -2.93702950848739e-12, -13227.205)
|
||||
p25 = FreeCAD.Vector(14495.425, -3.06342173850282e-12, -13796.425)
|
||||
p26 = FreeCAD.Vector(15046.97, -2.4753465943661e-12, -11147.97)
|
||||
p27 = FreeCAD.Vector(15046.97, -1.75370162835975e-12, -7897.97)
|
||||
points = [p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27]
|
||||
line = Draft.makeWire(points,closed=False,face=False,support=None)
|
||||
fcc_print('Checking FEM new analysis...')
|
||||
analysis = ObjectsFem.makeAnalysis('Analysis')
|
||||
self.assertTrue(analysis, "FemTest of new analysis failed")
|
||||
|
||||
fcc_print('Checking FEM new solver...')
|
||||
solver_object = ObjectsFem.makeSolverCalculix('CalculiX')
|
||||
solver_object.AnalysisType = 'thermomech'
|
||||
solver_object.GeometricalNonlinearity = 'linear'
|
||||
solver_object.ThermoMechSteadyState = True
|
||||
solver_object.MatrixSolverType = 'default'
|
||||
solver_object.IterationsThermoMechMaximum = 2000
|
||||
solver_object.IterationsControlParameterTimeUse = False
|
||||
self.assertTrue(solver_object, "FemTest of new solver failed")
|
||||
analysis.Member = analysis.Member + [solver_object]
|
||||
|
||||
fcc_print('Checking FEM new material...')
|
||||
new_material_object = ObjectsFem.makeMaterialFluid('FluidMaterial')
|
||||
mat = new_material_object.Material
|
||||
mat['Name'] = "Water"
|
||||
mat['Density'] = "998 kg/m^3"
|
||||
mat['SpecificHeat'] = "4.182 J/kg/K"
|
||||
mat['DynamicViscosity'] = "1.003e-3 kg/m/s"
|
||||
mat['VolumetricThermalExpansionCoefficient'] = "2.07e-4 m/m/K"
|
||||
mat['ThermalConductivity'] = "0.591 W/m/K"
|
||||
new_material_object.Material = mat
|
||||
self.assertTrue(new_material_object, "FemTest of new material failed")
|
||||
analysis.Member = analysis.Member + [new_material_object]
|
||||
|
||||
fcc_print('Checking FEM Flow1D inlet constraint...')
|
||||
Flow1d_inlet = self.active_doc.addObject("Fem::FeaturePython", "ElementFluid1D")
|
||||
import PyObjects._FemElementFluid1D
|
||||
PyObjects._FemElementFluid1D._FemElementFluid1D(Flow1d_inlet)
|
||||
Flow1d_inlet.SectionType = 'Liquid'
|
||||
Flow1d_inlet.LiquidSectionType = 'PIPE INLET'
|
||||
Flow1d_inlet.InletPressure = 0.1
|
||||
Flow1d_inlet.References = [(line, "Edge1")]
|
||||
self.assertTrue(Flow1d_inlet, "FemTest of new Flow1D inlet constraint failed")
|
||||
analysis.Member = analysis.Member + [Flow1d_inlet]
|
||||
|
||||
fcc_print('Checking FEM new Flow1D entrance constraint...')
|
||||
Flow1d_entrance = self.active_doc.addObject("Fem::FeaturePython", "ElementFluid1D")
|
||||
import PyObjects._FemElementFluid1D
|
||||
PyObjects._FemElementFluid1D._FemElementFluid1D(Flow1d_entrance)
|
||||
Flow1d_entrance.SectionType = 'Liquid'
|
||||
Flow1d_entrance.LiquidSectionType = 'PIPE ENTRANCE'
|
||||
Flow1d_entrance.EntrancePipeArea = 31416.00
|
||||
Flow1d_entrance.EntranceArea = 25133.00
|
||||
Flow1d_entrance.References = [(line, "Edge2")]
|
||||
self.assertTrue(Flow1d_entrance, "FemTest of new Flow1D entrance constraint failed")
|
||||
analysis.Member = analysis.Member + [Flow1d_entrance]
|
||||
|
||||
fcc_print('Checking FEM new Flow1D manning constraint...')
|
||||
Flow1d_manning = self.active_doc.addObject("Fem::FeaturePython", "ElementFluid1D")
|
||||
import PyObjects._FemElementFluid1D
|
||||
PyObjects._FemElementFluid1D._FemElementFluid1D(Flow1d_manning)
|
||||
Flow1d_manning.SectionType = 'Liquid'
|
||||
Flow1d_manning.LiquidSectionType = 'PIPE MANNING'
|
||||
Flow1d_manning.ManningArea = 31416
|
||||
Flow1d_manning.ManningRadius = 50
|
||||
Flow1d_manning.ManningCoefficient = 0.002
|
||||
Flow1d_manning.References = [(line, "Edge3"), (line, "Edge5")]
|
||||
self.assertTrue(Flow1d_manning, "FemTest of new Flow1D manning constraint failed")
|
||||
analysis.Member = analysis.Member + [Flow1d_manning]
|
||||
|
||||
fcc_print('Checking FEM new Flow1D bend constraint...')
|
||||
Flow1d_bend = self.active_doc.addObject("Fem::FeaturePython", "ElementFluid1D")
|
||||
import PyObjects._FemElementFluid1D
|
||||
PyObjects._FemElementFluid1D._FemElementFluid1D(Flow1d_bend)
|
||||
Flow1d_bend.SectionType = 'Liquid'
|
||||
Flow1d_bend.LiquidSectionType = 'PIPE BEND'
|
||||
Flow1d_bend.BendPipeArea = 31416
|
||||
Flow1d_bend.BendRadiusDiameter = 1.5
|
||||
Flow1d_bend.BendAngle = 45
|
||||
Flow1d_bend.BendLossCoefficient = 0.4
|
||||
Flow1d_bend.References = [(line, "Edge4")]
|
||||
self.assertTrue(Flow1d_bend, "FemTest of new Flow1D bend constraint failed")
|
||||
analysis.Member = analysis.Member + [Flow1d_bend]
|
||||
|
||||
fcc_print('Checking FEM new Flow1D enlargement constraint...')
|
||||
Flow1d_enlargement = self.active_doc.addObject("Fem::FeaturePython", "ElementFluid1D")
|
||||
import PyObjects._FemElementFluid1D
|
||||
PyObjects._FemElementFluid1D._FemElementFluid1D(Flow1d_enlargement)
|
||||
Flow1d_enlargement.SectionType = 'Liquid'
|
||||
Flow1d_enlargement.LiquidSectionType = 'PIPE ENLARGEMENT'
|
||||
Flow1d_enlargement.EnlargeArea1 = 31416.00
|
||||
Flow1d_enlargement.EnlargeArea2 = 70686.00
|
||||
Flow1d_enlargement.References = [(line, "Edge6")]
|
||||
self.assertTrue(Flow1d_enlargement, "FemTest of new Flow1D enlargement constraint failed")
|
||||
analysis.Member = analysis.Member + [Flow1d_enlargement]
|
||||
|
||||
fcc_print('Checking FEM new Flow1D manning constraint...')
|
||||
Flow1d_manning1 = self.active_doc.addObject("Fem::FeaturePython", "ElementFluid1D")
|
||||
import PyObjects._FemElementFluid1D
|
||||
PyObjects._FemElementFluid1D._FemElementFluid1D(Flow1d_manning1)
|
||||
Flow1d_manning1.SectionType = 'Liquid'
|
||||
Flow1d_manning1.LiquidSectionType = 'PIPE MANNING'
|
||||
Flow1d_manning1.ManningArea = 70686.00
|
||||
Flow1d_manning1.ManningRadius = 75
|
||||
Flow1d_manning1.ManningCoefficient = 0.002
|
||||
Flow1d_manning1.References = [(line, "Edge7")]
|
||||
self.assertTrue(Flow1d_manning1, "FemTest of new Flow1D manning constraint failed")
|
||||
analysis.Member = analysis.Member + [Flow1d_manning1]
|
||||
|
||||
fcc_print('Checking FEM new Flow1D contraction constraint...')
|
||||
Flow1d_contraction = self.active_doc.addObject("Fem::FeaturePython", "ElementFluid1D")
|
||||
import PyObjects._FemElementFluid1D
|
||||
PyObjects._FemElementFluid1D._FemElementFluid1D(Flow1d_contraction)
|
||||
Flow1d_contraction.SectionType = 'Liquid'
|
||||
Flow1d_contraction.LiquidSectionType = 'PIPE CONTRACTION'
|
||||
Flow1d_contraction.ContractArea1 = 70686
|
||||
Flow1d_contraction.ContractArea2 = 17671
|
||||
Flow1d_contraction.References = [(line, "Edge8")]
|
||||
self.assertTrue(Flow1d_contraction, "FemTest of new Flow1D contraction constraint failed")
|
||||
analysis.Member = analysis.Member + [Flow1d_contraction]
|
||||
|
||||
fcc_print('Checking FEM new Flow1D manning constraint...')
|
||||
Flow1d_manning2 = self.active_doc.addObject("Fem::FeaturePython", "ElementFluid1D")
|
||||
import PyObjects._FemElementFluid1D
|
||||
PyObjects._FemElementFluid1D._FemElementFluid1D(Flow1d_manning2)
|
||||
Flow1d_manning2.SectionType = 'Liquid'
|
||||
Flow1d_manning2.LiquidSectionType = 'PIPE MANNING'
|
||||
Flow1d_manning2.ManningArea = 17671.00
|
||||
Flow1d_manning2.ManningRadius = 37.5
|
||||
Flow1d_manning2.ManningCoefficient = 0.002
|
||||
Flow1d_manning2.References = [(line, "Edge11"), (line, "Edge9")]
|
||||
self.assertTrue(Flow1d_manning2, "FemTest of new Flow1D manning constraint failed")
|
||||
analysis.Member = analysis.Member + [Flow1d_manning2]
|
||||
|
||||
fcc_print('Checking FEM new Flow1D gate valve constraint...')
|
||||
Flow1d_gate_valve = self.active_doc.addObject("Fem::FeaturePython", "ElementFluid1D")
|
||||
import PyObjects._FemElementFluid1D
|
||||
PyObjects._FemElementFluid1D._FemElementFluid1D(Flow1d_gate_valve)
|
||||
Flow1d_gate_valve.SectionType = 'Liquid'
|
||||
Flow1d_gate_valve.LiquidSectionType = 'PIPE GATE VALVE'
|
||||
Flow1d_gate_valve.GateValvePipeArea = 17671
|
||||
Flow1d_gate_valve.GateValveClosingCoeff = 0.5
|
||||
Flow1d_gate_valve.References = [(line, "Edge10")]
|
||||
self.assertTrue(Flow1d_gate_valve, "FemTest of new Flow1D gate valve constraint failed")
|
||||
analysis.Member = analysis.Member + [Flow1d_gate_valve]
|
||||
|
||||
fcc_print('Checking FEM new Flow1D enlargement constraint...')
|
||||
Flow1d_enlargement1 = self.active_doc.addObject("Fem::FeaturePython", "ElementFluid1D")
|
||||
import PyObjects._FemElementFluid1D
|
||||
PyObjects._FemElementFluid1D._FemElementFluid1D(Flow1d_enlargement1)
|
||||
Flow1d_enlargement1.SectionType = 'Liquid'
|
||||
Flow1d_enlargement1.LiquidSectionType = 'PIPE ENLARGEMENT'
|
||||
Flow1d_enlargement1.EnlargeArea1 = 17671
|
||||
Flow1d_enlargement1.EnlargeArea2 = 1000000000000
|
||||
Flow1d_enlargement1.References = [(line, "Edge12")]
|
||||
self.assertTrue(Flow1d_enlargement1, "FemTest of new Flow1D enlargement constraint failed")
|
||||
analysis.Member = analysis.Member + [Flow1d_enlargement1]
|
||||
|
||||
fcc_print('Checking FEM Flow1D outlet constraint...')
|
||||
Flow1d_outlet = self.active_doc.addObject("Fem::FeaturePython", "ElementFluid1D")
|
||||
import PyObjects._FemElementFluid1D
|
||||
PyObjects._FemElementFluid1D._FemElementFluid1D(Flow1d_outlet)
|
||||
Flow1d_outlet.SectionType = 'Liquid'
|
||||
Flow1d_outlet.LiquidSectionType = 'PIPE OUTLET'
|
||||
Flow1d_outlet.OutletPressure = 0.1
|
||||
Flow1d_outlet.References = [(line, "Edge13")]
|
||||
self.assertTrue(Flow1d_outlet, "FemTest of new Flow1D inlet constraint failed")
|
||||
analysis.Member = analysis.Member + [Flow1d_outlet]
|
||||
|
||||
fcc_print('Checking FEM self weight constraint...')
|
||||
Flow1d_self_weight = self.active_doc.addObject("Fem::FeaturePython", "ConstraintSelfWeight")
|
||||
import PyObjects._FemConstraintSelfWeight
|
||||
PyObjects._FemConstraintSelfWeight._FemConstraintSelfWeight(Flow1d_self_weight)
|
||||
Flow1d_self_weight.Gravity_x = 0.0
|
||||
Flow1d_self_weight.Gravity_y = 0.0
|
||||
Flow1d_self_weight.Gravity_z = -1.0
|
||||
self.assertTrue(Flow1d_outlet, "FemTest of new Flow1D self weight constraint failed")
|
||||
analysis.Member = analysis.Member + [Flow1d_self_weight]
|
||||
|
||||
fcc_print('Checking FEM new mesh...')
|
||||
from test_files.ccx.Flow1D_mesh import create_nodes_Flow1D, create_elements_Flow1D
|
||||
mesh = Fem.FemMesh()
|
||||
ret = create_nodes_Flow1D(mesh)
|
||||
self.assertTrue(ret, "Import of mesh nodes failed")
|
||||
ret = create_elements_Flow1D(mesh)
|
||||
self.assertTrue(ret, "Import of mesh volumes failed")
|
||||
mesh_object = self.active_doc.addObject('Fem::FemMeshObject', mesh_name)
|
||||
mesh_object.FemMesh = mesh
|
||||
self.assertTrue(mesh, "FemTest of new mesh failed")
|
||||
analysis.Member = analysis.Member + [mesh_object]
|
||||
|
||||
self.active_doc.recompute()
|
||||
|
||||
fea = FemToolsCcx.FemToolsCcx(analysis, test_mode=True)
|
||||
fcc_print('Setting up working directory {}'.format(Flow1D_thermomech_analysis_dir))
|
||||
fea.setup_working_dir(Flow1D_thermomech_analysis_dir)
|
||||
self.assertTrue(True if fea.working_dir == Flow1D_thermomech_analysis_dir else False,
|
||||
"Setting working directory {} failed".format(Flow1D_thermomech_analysis_dir))
|
||||
|
||||
fcc_print('Setting analysis type to \'thermomech\"')
|
||||
fea.set_analysis_type("thermomech")
|
||||
self.assertTrue(True if fea.analysis_type == 'thermomech' else False, "Setting anlysis type to \'thermomech\' failed")
|
||||
|
||||
fcc_print('Checking FEM inp file prerequisites for thermo-mechanical analysis...')
|
||||
error = fea.check_prerequisites()
|
||||
self.assertFalse(error, "FemToolsCcx check_prerequisites returned error message: {}".format(error))
|
||||
|
||||
fcc_print('Checking FEM inp file write...')
|
||||
|
||||
fcc_print('Writing {}/{}.inp for thermomech analysis'.format(Flow1D_thermomech_analysis_dir, mesh_name))
|
||||
error = fea.write_inp_file()
|
||||
self.assertFalse(error, "Writing failed")
|
||||
|
||||
fcc_print('Comparing {} to {}/{}.inp'.format(Flow1D_thermomech_analysis_inp_file, Flow1D_thermomech_analysis_dir, mesh_name))
|
||||
ret = compare_inp_files(Flow1D_thermomech_analysis_inp_file, Flow1D_thermomech_analysis_dir + "/" + mesh_name + '.inp')
|
||||
self.assertFalse(ret, "FemToolsCcx write_inp_file test failed.\n{}".format(ret))
|
||||
|
||||
fcc_print('Setting up working directory to {} in order to read simulated calculations'.format(test_file_dir))
|
||||
fea.setup_working_dir(test_file_dir)
|
||||
self.assertTrue(True if fea.working_dir == test_file_dir else False,
|
||||
"Setting working directory {} failed".format(test_file_dir))
|
||||
|
||||
fcc_print('Setting base name to read test {}.frd file...'.format('Flow1D_thermomech'))
|
||||
fea.set_base_name(Flow1D_thermomech_base_name)
|
||||
self.assertTrue(True if fea.base_name == Flow1D_thermomech_base_name else False,
|
||||
"Setting base name to {} failed".format(Flow1D_thermomech_base_name))
|
||||
|
||||
fcc_print('Setting inp file name to read test {}.frd file...'.format('Flow1D_thermomech'))
|
||||
fea.set_inp_file_name()
|
||||
self.assertTrue(True if fea.inp_file_name == Flow1D_thermomech_analysis_inp_file else False,
|
||||
"Setting inp file name to {} failed".format(Flow1D_thermomech_analysis_inp_file))
|
||||
|
||||
fcc_print('Checking FEM frd file read from thermomech analysis...')
|
||||
fea.load_results()
|
||||
self.assertTrue(fea.results_present, "Cannot read results from {}.frd frd file".format(fea.base_name))
|
||||
|
||||
fcc_print('Reading stats from result object for thermomech analysis...')
|
||||
ret = compare_stats(fea, Flow1D_thermomech_expected_values)
|
||||
self.assertFalse(ret, "Invalid results read from .frd file")
|
||||
|
||||
fcc_print('Save FreeCAD file for thermomech analysis to {}...'.format(Flow1D_thermomech_save_fc_file))
|
||||
self.active_doc.saveAs(Flow1D_thermomech_save_fc_file)
|
||||
|
||||
fcc_print('--------------- End of FEM tests FLow 1D thermomech analysis ---------------')
|
||||
|
||||
def tearDown(self):
|
||||
FreeCAD.closeDocument("FemTest")
|
||||
pass
|
||||
|
||||
49
src/Mod/Fem/test_files/ccx/Flow1D_mesh.py
Normal file
49
src/Mod/Fem/test_files/ccx/Flow1D_mesh.py
Normal file
@@ -0,0 +1,49 @@
|
||||
def create_nodes_Flow1D(femmesh):
|
||||
# nodes
|
||||
femmesh.addNode(0, 1.11022302462516e-14, 50, 1)
|
||||
femmesh.addNode(0, -1.11022302462516e-14, -50, 2)
|
||||
femmesh.addNode(0, -9.54791801177633e-13, -4300, 3)
|
||||
femmesh.addNode(4950, -9.54791801177633e-13, -4300, 4)
|
||||
femmesh.addNode(5000, -9.54791801177633e-13, -4300, 5)
|
||||
femmesh.addNode(8535.53, -1.73983716322823e-12, -7835.53, 6)
|
||||
femmesh.addNode(8569.88, -1.74768644001233e-12, -7870.88, 7)
|
||||
femmesh.addNode(12105.41, -2.53273180206292e-12, -11406.41, 8)
|
||||
femmesh.addNode(12140.76, -2.54058107884702e-12, -11441.76, 9)
|
||||
femmesh.addNode(13908.53, -2.93310487009534e-12, -13209.53, 10)
|
||||
femmesh.addNode(13943.88, -2.94095414687944e-12, -13244.88, 11)
|
||||
femmesh.addNode(15046.97, -3.1858893301262e-12, -14347.97, 12)
|
||||
femmesh.addNode(15046.97, -1.764803858606e-12, -7947.97, 13)
|
||||
femmesh.addNode(15046.97, -1.742599398113e-12, -7847.97, 14)
|
||||
femmesh.addNode(0, 0, 0, 15)
|
||||
femmesh.addNode(0, -4.82947015711942e-13, -2175, 16)
|
||||
femmesh.addNode(2475, -9.54791801177633e-13, -4300, 17)
|
||||
femmesh.addNode(4975, -9.54791801177633e-13, -4300, 18)
|
||||
femmesh.addNode(6767.765, -1.34731448220293e-12, -6067.765, 19)
|
||||
femmesh.addNode(8552.705, -1.74376180162028e-12, -7853.205, 20)
|
||||
femmesh.addNode(10337.645, -2.14020912103763e-12, -9638.645, 21)
|
||||
femmesh.addNode(12123.085, -2.53665644045497e-12, -11424.085, 22)
|
||||
femmesh.addNode(13024.645, -2.73684297447118e-12, -12325.645, 23)
|
||||
femmesh.addNode(13926.205, -2.93702950848739e-12, -13227.205, 24)
|
||||
femmesh.addNode(14495.425, -3.06342173850282e-12, -13796.425, 25)
|
||||
femmesh.addNode(15046.97, -2.4753465943661e-12, -11147.97, 26)
|
||||
femmesh.addNode(15046.97, -1.75370162835975e-12, -7897.97, 27)
|
||||
femmesh.addNode(15046.97, -1.75370162835975e-12, -7897.97, 28)
|
||||
return True
|
||||
|
||||
|
||||
def create_elements_Flow1D(femmesh):
|
||||
# elements
|
||||
femmesh.addEdge([1L, 2L, 15L], 1)
|
||||
femmesh.addEdge([2L, 3L, 16L], 2)
|
||||
femmesh.addEdge([3L, 4L, 17L], 3)
|
||||
femmesh.addEdge([4L, 5L, 18L], 4)
|
||||
femmesh.addEdge([5L, 6L, 19L], 5)
|
||||
femmesh.addEdge([6L, 7L, 20L], 6)
|
||||
femmesh.addEdge([7L, 8L, 21L], 7)
|
||||
femmesh.addEdge([8L, 9L, 22L], 8)
|
||||
femmesh.addEdge([9L, 10L, 23L], 9)
|
||||
femmesh.addEdge([10L, 11L, 24L], 10)
|
||||
femmesh.addEdge([11L, 12L, 25L], 11)
|
||||
femmesh.addEdge([12L, 13L, 26L], 12)
|
||||
femmesh.addEdge([13L, 28L, 27L], 13)
|
||||
return True
|
||||
27
src/Mod/Fem/test_files/ccx/Flow1D_points.csv
Normal file
27
src/Mod/Fem/test_files/ccx/Flow1D_points.csv
Normal file
@@ -0,0 +1,27 @@
|
||||
1,0,1.11E-14,50
|
||||
2,0,-1.11E-14,-50
|
||||
3,0,-9.55E-13,-4300
|
||||
4,4950,-9.54792E-13,-4300
|
||||
5,5000,-9.54792E-13,-4300
|
||||
6,8535.53,-1.73984E-12,-7835.53
|
||||
7,8569.88,-1.75E-12,-7870.88
|
||||
8,12105.41,-2.53273E-12,-11406.41
|
||||
9,12140.76,-2.54058E-12,-11441.76
|
||||
10,13908.53,-2.9331E-12,-13209.53
|
||||
11,13943.88,-2.94095E-12,-13244.88
|
||||
12,15046.97,-3.18589E-12,-14347.97
|
||||
13,15046.97,-1.7648E-12,-7947.97
|
||||
14,15046.97,-1.74E-12,-7847.97
|
||||
15,0,0,0
|
||||
16,0,-4.82947E-13,-2175
|
||||
17,2475,-9.54792E-13,-4300
|
||||
18,4975,-9.54792E-13,-4300
|
||||
19,6767.765,-1.34731E-12,-6067.765
|
||||
20,8552.705,-1.74376E-12,-7853.205
|
||||
21,10337.645,-2.14021E-12,-9638.645
|
||||
22,12123.085,-2.53666E-12,-11424.085
|
||||
23,13024.645,-2.73684E-12,-12325.645
|
||||
24,13926.205,-2.93703E-12,-13227.205
|
||||
25,14495.425,-3.06342E-12,-13796.425
|
||||
26,15046.97,-2.47535E-12,-11147.97
|
||||
27,15046.97,-1.75E-12,-7897.97
|
||||
|
0
src/Mod/Fem/test_files/ccx/Flow1D_thermomech.dat
Normal file
0
src/Mod/Fem/test_files/ccx/Flow1D_thermomech.dat
Normal file
BIN
src/Mod/Fem/test_files/ccx/Flow1D_thermomech.fcstd
Normal file
BIN
src/Mod/Fem/test_files/ccx/Flow1D_thermomech.fcstd
Normal file
Binary file not shown.
125
src/Mod/Fem/test_files/ccx/Flow1D_thermomech.frd
Normal file
125
src/Mod/Fem/test_files/ccx/Flow1D_thermomech.frd
Normal file
@@ -0,0 +1,125 @@
|
||||
1C
|
||||
1UUSER
|
||||
1UDATE 09.june.2017
|
||||
1UTIME 11:49:27
|
||||
1UHOST
|
||||
1UPGM CalculiX
|
||||
1UDIR
|
||||
1UDBN
|
||||
1UMAT 1FLUIDMATERIAL
|
||||
2C 25 1
|
||||
-1 2 0.00000E+00-1.11022E-14-5.00000E+01
|
||||
-1 3 0.00000E+00-9.54792E-13-4.30000E+03
|
||||
-1 4 4.95000E+03-9.54792E-13-4.30000E+03
|
||||
-1 5 5.00000E+03-9.54792E-13-4.30000E+03
|
||||
-1 6 8.53553E+03-1.73984E-12-7.83553E+03
|
||||
-1 7 8.56988E+03-1.74769E-12-7.87088E+03
|
||||
-1 8 1.21054E+04-2.53273E-12-1.14064E+04
|
||||
-1 9 1.21408E+04-2.54058E-12-1.14418E+04
|
||||
-1 10 1.39085E+04-2.93310E-12-1.32095E+04
|
||||
-1 11 1.39439E+04-2.94095E-12-1.32449E+04
|
||||
-1 12 1.50470E+04-3.18589E-12-1.43480E+04
|
||||
-1 13 1.50470E+04-1.76480E-12-7.94797E+03
|
||||
-1 15 0.00000E+00 0.00000E+00 0.00000E+00
|
||||
-1 16 0.00000E+00-4.82947E-13-2.17500E+03
|
||||
-1 17 2.47500E+03-9.54792E-13-4.30000E+03
|
||||
-1 18 4.97500E+03-9.54792E-13-4.30000E+03
|
||||
-1 19 6.76777E+03-1.34731E-12-6.06777E+03
|
||||
-1 20 8.55271E+03-1.74376E-12-7.85321E+03
|
||||
-1 21 1.03376E+04-2.14021E-12-9.63864E+03
|
||||
-1 22 1.21231E+04-2.53666E-12-1.14241E+04
|
||||
-1 23 1.30246E+04-2.73684E-12-1.23256E+04
|
||||
-1 24 1.39262E+04-2.93703E-12-1.32272E+04
|
||||
-1 25 1.44954E+04-3.06342E-12-1.37964E+04
|
||||
-1 26 1.50470E+04-2.47535E-12-1.11480E+04
|
||||
-1 27 1.50470E+04-1.75370E-12-7.89797E+03
|
||||
-3
|
||||
3C 13 1
|
||||
-1 1 11 0 1
|
||||
-2 15 2
|
||||
-1 2 12 0 1
|
||||
-2 2 3 16
|
||||
-1 3 12 0 1
|
||||
-2 3 4 17
|
||||
-1 4 12 0 1
|
||||
-2 4 5 18
|
||||
-1 5 12 0 1
|
||||
-2 5 6 19
|
||||
-1 6 12 0 1
|
||||
-2 6 7 20
|
||||
-1 7 12 0 1
|
||||
-2 7 8 21
|
||||
-1 8 12 0 1
|
||||
-2 8 9 22
|
||||
-1 9 12 0 1
|
||||
-2 9 10 23
|
||||
-1 10 12 0 1
|
||||
-2 10 11 24
|
||||
-1 11 12 0 1
|
||||
-2 11 12 25
|
||||
-1 12 12 0 1
|
||||
-2 12 13 26
|
||||
-1 13 11 0 1
|
||||
-2 13 27
|
||||
-3
|
||||
1PSTEP 1 1 1
|
||||
100CL 101 1.000000000 25 0 1 1
|
||||
-4 MAFLOW 1 1
|
||||
-5 MF 1 1 0 0
|
||||
-1 2 7.83805E-02
|
||||
-1 3 7.83805E-02
|
||||
-1 4 7.83805E-02
|
||||
-1 5 7.83805E-02
|
||||
-1 6 7.83805E-02
|
||||
-1 7 7.83805E-02
|
||||
-1 8 7.83805E-02
|
||||
-1 9 7.83805E-02
|
||||
-1 10 7.83805E-02
|
||||
-1 11 7.83805E-02
|
||||
-1 12 7.83805E-02
|
||||
-1 13 7.83805E-02
|
||||
-1 15 7.83805E-02
|
||||
-1 16 7.83805E-02
|
||||
-1 17 7.83805E-02
|
||||
-1 18 7.83805E-02
|
||||
-1 19 7.83805E-02
|
||||
-1 20 7.83805E-02
|
||||
-1 21 7.83805E-02
|
||||
-1 22 7.83805E-02
|
||||
-1 23 7.83805E-02
|
||||
-1 24 7.83805E-02
|
||||
-1 25 7.83805E-02
|
||||
-1 26 7.83805E-02
|
||||
-1 27 7.83805E-02
|
||||
-3
|
||||
1PSTEP 2 1 1
|
||||
100CL 101 1.000000000 25 0 1 1
|
||||
-4 STPRES 1 1
|
||||
-5 PS 1 1 0 0
|
||||
-1 2 1.00000E-01
|
||||
-1 3 1.34842E-01
|
||||
-1 4 1.28265E-01
|
||||
-1 5 1.27953E-01
|
||||
-1 6 1.55924E-01
|
||||
-1 7 1.57802E-01
|
||||
-1 8 1.91652E-01
|
||||
-1 9 1.78963E-01
|
||||
-1 10 1.80863E-01
|
||||
-1 11 1.61473E-01
|
||||
-1 12 1.62658E-01
|
||||
-1 13 1.00000E-01
|
||||
-1 15 1.00000E-01
|
||||
-1 16 1.17421E-01
|
||||
-1 17 1.31553E-01
|
||||
-1 18 1.28109E-01
|
||||
-1 19 1.41939E-01
|
||||
-1 20 1.56863E-01
|
||||
-1 21 1.74727E-01
|
||||
-1 22 1.85308E-01
|
||||
-1 23 1.79913E-01
|
||||
-1 24 1.71168E-01
|
||||
-1 25 1.62066E-01
|
||||
-1 26 1.31329E-01
|
||||
-1 27 1.00000E-01
|
||||
-3
|
||||
9999
|
||||
185
src/Mod/Fem/test_files/ccx/Flow1D_thermomech.inp
Normal file
185
src/Mod/Fem/test_files/ccx/Flow1D_thermomech.inp
Normal file
@@ -0,0 +1,185 @@
|
||||
** written by FreeCAD inp file writer for CalculiX,Abaqus meshes
|
||||
|
||||
** Nodes
|
||||
*Node, NSET=Nall
|
||||
1, 0, 1.110223024625e-14, 50
|
||||
2, 0, -1.110223024625e-14, -50
|
||||
3, 0, -9.547918011776e-13, -4300
|
||||
4, 4950, -9.547918011776e-13, -4300
|
||||
5, 5000, -9.547918011776e-13, -4300
|
||||
6, 8535.53, -1.739837163228e-12, -7835.53
|
||||
7, 8569.88, -1.747686440012e-12, -7870.88
|
||||
8, 12105.41, -2.532731802063e-12, -11406.41
|
||||
9, 12140.76, -2.540581078847e-12, -11441.76
|
||||
10, 13908.53, -2.933104870095e-12, -13209.53
|
||||
11, 13943.88, -2.940954146879e-12, -13244.88
|
||||
12, 15046.97, -3.185889330126e-12, -14347.97
|
||||
13, 15046.97, -1.764803858606e-12, -7947.97
|
||||
14, 15046.97, -1.742599398113e-12, -7847.97
|
||||
15, 0, 0, 0
|
||||
16, 0, -4.829470157119e-13, -2175
|
||||
17, 2475, -9.547918011776e-13, -4300
|
||||
18, 4975, -9.547918011776e-13, -4300
|
||||
19, 6767.765, -1.347314482203e-12, -6067.765
|
||||
20, 8552.705, -1.74376180162e-12, -7853.205
|
||||
21, 10337.645, -2.140209121038e-12, -9638.645
|
||||
22, 12123.085, -2.536656440455e-12, -11424.085
|
||||
23, 13024.645, -2.736842974471e-12, -12325.645
|
||||
24, 13926.205, -2.937029508487e-12, -13227.205
|
||||
25, 14495.425, -3.063421738503e-12, -13796.425
|
||||
26, 15046.97, -2.475346594366e-12, -11147.97
|
||||
27, 15046.97, -1.75370162836e-12, -7897.97
|
||||
28, 15046.97, -1.75370162836e-12, -7897.97
|
||||
|
||||
|
||||
** Edge elements
|
||||
*Element, TYPE=D, ELSET=Eedges
|
||||
1, 0, 15, 2
|
||||
2, 2, 16, 3
|
||||
3, 3, 17, 4
|
||||
4, 4, 18, 5
|
||||
5, 5, 19, 6
|
||||
6, 6, 20, 7
|
||||
7, 7, 21, 8
|
||||
8, 8, 22, 9
|
||||
9, 9, 23, 10
|
||||
10, 10, 24, 11
|
||||
11, 11, 25, 12
|
||||
12, 12, 26, 13
|
||||
13, 13, 27, 0
|
||||
|
||||
** Define element set Eall
|
||||
*ELSET, ELSET=Eall
|
||||
Eedges
|
||||
|
||||
|
||||
|
||||
***********************************************************
|
||||
** Element sets for materials and FEM element type (solid, shell, beam, fluid)
|
||||
** written by write_element_sets_material_and_femelement_type function
|
||||
*ELSET,ELSET=Mat0Fluid0
|
||||
1,
|
||||
*ELSET,ELSET=Mat0Fluid1
|
||||
2,
|
||||
*ELSET,ELSET=Mat0Fluid2
|
||||
3,
|
||||
5,
|
||||
*ELSET,ELSET=Mat0Fluid3
|
||||
4,
|
||||
*ELSET,ELSET=Mat0Fluid4
|
||||
6,
|
||||
*ELSET,ELSET=Mat0Fluid5
|
||||
7,
|
||||
*ELSET,ELSET=Mat0Fluid6
|
||||
8,
|
||||
*ELSET,ELSET=Mat0Fluid7
|
||||
9,
|
||||
11,
|
||||
*ELSET,ELSET=Mat0Fluid8
|
||||
10,
|
||||
*ELSET,ELSET=Mat0Fluid9
|
||||
12,
|
||||
*ELSET,ELSET=Mat0Fluid10
|
||||
13,
|
||||
|
||||
***********************************************************
|
||||
** Materials
|
||||
** written by write_materials function
|
||||
** Young's modulus unit is MPa = N/mm2
|
||||
** Density's unit is t/mm^3
|
||||
** Thermal conductivity unit is kW/mm/K = t*mm/K*s^3
|
||||
** Specific Heat unit is kJ/t/K = mm^2/s^2/K
|
||||
** FreeCAD material name: Water
|
||||
** FluidMaterial
|
||||
*MATERIAL, NAME=FluidMaterial
|
||||
*DENSITY
|
||||
9.980e-10
|
||||
*FLUID CONSTANTS
|
||||
4.182e+06, 1.003e-09
|
||||
|
||||
***********************************************************
|
||||
** Sections
|
||||
** written by write_femelementsets function
|
||||
*FLUID SECTION, ELSET=Mat0Fluid0, TYPE=PIPE INOUT, MATERIAL=FluidMaterial
|
||||
*FLUID SECTION, ELSET=Mat0Fluid1, TYPE=PIPE ENTRANCE, MATERIAL=FluidMaterial
|
||||
31416.0,25133.0
|
||||
*FLUID SECTION, ELSET=Mat0Fluid2, TYPE=PIPE MANNING, MATERIAL=FluidMaterial
|
||||
31416.0,50 ,0.002
|
||||
*FLUID SECTION, ELSET=Mat0Fluid3, TYPE=PIPE BEND, MATERIAL=FluidMaterial
|
||||
31416.0,1.5,45.0,0.4
|
||||
*FLUID SECTION, ELSET=Mat0Fluid4, TYPE=PIPE ENLARGEMENT, MATERIAL=FluidMaterial
|
||||
31416.0,70686.0
|
||||
*FLUID SECTION, ELSET=Mat0Fluid5, TYPE=PIPE MANNING, MATERIAL=FluidMaterial
|
||||
70686.0,75 ,0.002
|
||||
*FLUID SECTION, ELSET=Mat0Fluid6, TYPE=PIPE CONTRACTION, MATERIAL=FluidMaterial
|
||||
70686.0,17671.0
|
||||
*FLUID SECTION, ELSET=Mat0Fluid7, TYPE=PIPE MANNING, MATERIAL=FluidMaterial
|
||||
17671.0,37.5 ,0.002
|
||||
*FLUID SECTION, ELSET=Mat0Fluid8, TYPE=PIPE GATE VALVE, MATERIAL=FluidMaterial
|
||||
17671.0,0.5
|
||||
*FLUID SECTION, ELSET=Mat0Fluid9, TYPE=PIPE ENLARGEMENT, MATERIAL=FluidMaterial
|
||||
17671.0,1e+12
|
||||
*FLUID SECTION, ELSET=Mat0Fluid10, TYPE=PIPE INOUT, MATERIAL=FluidMaterial
|
||||
|
||||
***********************************************************
|
||||
** At least one step is needed to run an CalculiX analysis of FreeCAD
|
||||
** written by write_step_begin function
|
||||
*STEP, INC=2000
|
||||
*COUPLED TEMPERATURE-DISPLACEMENT, STEADY STATE
|
||||
1.0,1.0
|
||||
|
||||
***********************************************************
|
||||
** Self weight Constraint
|
||||
** written by write_constraints_selfweight function
|
||||
** ConstraintSelfWeight
|
||||
*DLOAD
|
||||
Eall,GRAV,9810,0.0,0.0,-1.0
|
||||
|
||||
|
||||
***********************************************************
|
||||
** FluidSection constraints
|
||||
** written by write_constraints_fluidsection function
|
||||
** ElementFluid1D
|
||||
**Fluid Section Inlet
|
||||
*BOUNDARY
|
||||
2,2,2,0.1
|
||||
** ElementFluid1D001
|
||||
** ElementFluid1D002
|
||||
** ElementFluid1D003
|
||||
** ElementFluid1D004
|
||||
** ElementFluid1D005
|
||||
** ElementFluid1D006
|
||||
** ElementFluid1D007
|
||||
** ElementFluid1D008
|
||||
** ElementFluid1D009
|
||||
** ElementFluid1D010
|
||||
**Fluid Section Outlet
|
||||
*BOUNDARY
|
||||
13,2,2,0.1
|
||||
|
||||
***********************************************************
|
||||
** Outputs --> frd file
|
||||
** written by write_outputs_types function
|
||||
*NODE FILE, OUTPUT=2d
|
||||
MF, PS
|
||||
|
||||
***********************************************************
|
||||
** written by write_step_end function
|
||||
*END STEP
|
||||
|
||||
***********************************************************
|
||||
** CalculiX Input file
|
||||
** written by write_footer function
|
||||
** written by --> FreeCAD 0.17.11265 (Git)
|
||||
** written on --> Fri Jun 9 11:49:27 2017
|
||||
** file name --> Resevoir_rev1.fcstd
|
||||
** analysis name --> Analysis
|
||||
**
|
||||
**
|
||||
**
|
||||
** Units
|
||||
**
|
||||
** Geometry (mesh data) --> mm
|
||||
** Materials (Young's modulus) --> N/mm2 = MPa
|
||||
** Loads (nodal loads) --> N
|
||||
**
|
||||
@@ -0,0 +1,5 @@
|
||||
U1: (0.0, 0.0, 0.0)
|
||||
U2: (0.0, 0.0, 0.0)
|
||||
U3: (0.0, 0.0, 0.0)
|
||||
Uabs: (0.0, 0.0, 0.0)
|
||||
Sabs: (0.0, 0.0, 0.0)
|
||||
13
src/Mod/Fem/test_files/ccx/Flow1D_volumes.csv
Normal file
13
src/Mod/Fem/test_files/ccx/Flow1D_volumes.csv
Normal file
@@ -0,0 +1,13 @@
|
||||
1,0,15,2
|
||||
2,2,16,3
|
||||
3,3,17,4
|
||||
4,4,18,5
|
||||
5,5,19,6
|
||||
6,6,20,7
|
||||
7,7,21,8
|
||||
8,8,22,9
|
||||
9,9,23,10
|
||||
10,10,24,11
|
||||
11,11,25,12
|
||||
12,12,26,13
|
||||
13,13,27,0
|
||||
|
Reference in New Issue
Block a user