コード例 #1
0
ファイル: run_test.py プロジェクト: vchen30/Kratos
                        "DISTANCE": DISTANCE, }

# defining a model part for the fluid
fluid_model_part = ModelPart("FluidPart")

if "REACTION" in ProjectParameters.nodal_results:
    fluid_model_part.AddNodalSolutionStepVariable(REACTION)
if "DISTANCE" in ProjectParameters.nodal_results:
    fluid_model_part.AddNodalSolutionStepVariable(DISTANCE)

#
# importing the solvers needed
SolverType = ProjectParameters.SolverType
if(SolverType == "FractionalStep"):
    import vms_fractional_step_solver as solver
    solver.AddVariables(fluid_model_part)
elif(SolverType == "monolithic_solver_eulerian"):
    import vms_monolithic_solver as solver
    solver.AddVariables(fluid_model_part)
else:
    raise NameError("solver type not supported: options are FractionalStep  - monolithic_solver_eulerian")

if(ProjectParameters.TurbulenceModel == "Spalart-Allmaras"):
    fluid_model_part.AddNodalSolutionStepVariable(TURBULENT_VISCOSITY)
    fluid_model_part.AddNodalSolutionStepVariable(MOLECULAR_VISCOSITY)
    fluid_model_part.AddNodalSolutionStepVariable(TEMP_CONV_PROJ)

    fluid_model_part.AddNodalSolutionStepVariable(DISTANCE)
# introducing input file name
input_file_name = ProjectParameters.problem_name
コード例 #2
0
    benchmarking.Output(time, "Time", 1e-7)
    benchmarking.Output(min_press, "minimum pressure", 0.00001)
    benchmarking.Output(max_press, "maximum pressure", 0.00001)
    benchmarking.Output(id_min_vel,
                        "Id of the node with minimum velocity norm", 0.0)
    benchmarking.Output(x_min_vel, "coord x minimum velocity norm", 0.0)
    benchmarking.Output(y_min_vel, "coord y minimum velocity norm", 0.0)


# defining a model part for the fluid and one for the structure
fluid_model_part = ModelPart("FluidPart")

#
# importing the solvers needed
import vms_fractional_step_solver as fractional_step_solver
fractional_step_solver.AddVariables(fluid_model_part)

# reading the fluid part
model_part_io_fluid = ModelPartIO(problem_name)
model_part_io_fluid.ReadModelPart(fluid_model_part)

# setting up the buffer size: SHOULD BE DONE AFTER READING!!!
fluid_model_part.SetBufferSize(3)

# adding dofs
fractional_step_solver.AddDofs(fluid_model_part)
# check to ensure that no node has zero density or pressure
for node in fluid_model_part.Nodes:
    if (node.GetSolutionStepValue(DENSITY) == 0.0):
        print("node ", node.Id, " has zero density!")
        raise 'node with zero density found'