Beispiel #1
0
    def _runTest(self, settings_file_name):
        model = km.Model()
        with open(settings_file_name, 'r') as settings_file:
            settings = km.Parameters(settings_file.read())

        # to check the results: add output settings block if needed
        if self.print_output:
            settings.AddValue(
                "output_configuration",
                km.Parameters(r'''{
                "result_file_configuration" : {
                    "gidpost_flags"       : {
                        "GiDPostMode"           : "GiD_PostBinary",
                        "WriteDeformedMeshFlag" : "WriteDeformed",
                        "WriteConditionsFlag"   : "WriteConditions",
                        "MultiFileFlag"         : "SingleFile"
                    },
                    "file_label"          : "time",
                    "output_control_type" : "step",
                    "output_frequency"    : 1,
                    "body_output"         : true,
                    "node_output"         : false,
                    "skin_output"         : false,
                    "plane_output"        : [],
                    "nodal_results"       : ["VELOCITY","PRESSURE"],
                    "gauss_point_results" : []
                },
                "point_data_configuration"  : []
            }'''))

        analysis = FluidAnalysisWithoutSolution(model, settings)
        analysis.Run()
Beispiel #2
0
    def _runTest(self,settings_file_name):
        model = km.Model()
        with open(settings_file_name,'r') as settings_file:
            settings = km.Parameters(settings_file.read())

        # to check the results: add output settings block if needed
        if self.print_output:
            settings.AddValue("output_processes", km.Parameters(r'''{
                "gid_output" : [{
                    "python_module" : "gid_output_process",
                    "kratos_module" : "KratosMultiphysics",
                    "process_name"  : "GiDOutputProcess",
                    "Parameters"    : {
                        "model_part_name"        : "MainModelPart.fluid_computational_model_part",
                        "output_name"            : "cavity",
                        "postprocess_parameters" : {
                            "result_file_configuration" : {
                                "gidpost_flags"       : {
                                    "GiDPostMode"           : "GiD_PostBinary",
                                    "WriteDeformedMeshFlag" : "WriteDeformed",
                                    "WriteConditionsFlag"   : "WriteConditions",
                                    "MultiFileFlag"         : "SingleFile"
                                },
                                "file_label"          : "time",
                                "output_control_type" : "step",
                                "output_interval"     : 1,
                                "body_output"         : true,
                                "node_output"         : false,
                                "skin_output"         : false,
                                "plane_output"        : [],
                                "nodal_results"       : ["VELOCITY","PRESSURE"],
                                "gauss_point_results" : []
                            },
                            "point_data_configuration"  : []
                        }
                    }
                }]
            }'''))

        analysis = FluidAnalysisWithoutSolution(model,settings)
        analysis.Run()
Beispiel #3
0
    def testInputOutput(self):
        with ControlledExecutionScope(self.work_folder):
            # run simulation and write to hdf5 file
            model_out = Model()
            with open("output_test_parameters.json", 'r') as parameter_file:
                project_parameters = Parameters(parameter_file.read())
            test = FluidDynamicsAnalysis(model_out, project_parameters)
            test.Run()

            # start new simulation and read from hdf5 file
            model_in = Model()
            with open("input_test_parameters.json", 'r') as parameter_file:
                project_parameters = Parameters(parameter_file.read())
            test = FluidAnalysisWithoutSolution(model_in, project_parameters)
            test.Run()