Skip to content

FreeSurface Add initial files#880

Merged
jginternational merged 33 commits intomasterfrom
add/freesurface
Aug 9, 2022
Merged

FreeSurface Add initial files#880
jginternational merged 33 commits intomasterfrom
add/freesurface

Conversation

@jginternational
Copy link
Copy Markdown
Member

@jginternational jginternational commented Jun 27, 2022

I'm creating this draft so we can follow the new features and developments.

From the tree, I can see:
Tree_FreeSurface

  • Add Distance to Initial Conditions
  • Remove No-Slip from Conditions
  • Add Porosity, Lin_Darcy_Coef and NoLin_Darcy_Coef to Condition
    Note: Check parameters in attached json file
    Note: Find a better public name to Lin Darcy Coef, Linear darcy coefficient?
  • Materials are not assigned to Parts, place Density and Viscosity and ... somewhere else
  • Check solver_settings in attached json file

It will be nice to attach also a running example (compressed gid folder with the model that runs on kratos) and specify if it runs on master or another branch

attached json:

 {
    "analysis_stage"   : "KratosMultiphysics.FreeSurfaceApplication.free_surface_analysis",
    "problem_data"     : {
        "problem_name"  : "Fuids_09",
        "parallel_type" : "OpenMP",
        "echo_level"    : 0,
        "start_time"    : 0.0,
        "end_time"      : 5
    },
    "output_processes" : {
        "gid_output" : [{
            "python_module" : "gid_output_process",
            "kratos_module" : "KratosMultiphysics",
            "process_name"  : "GiDOutputProcess",
           "Parameters"    : {
                "model_part_name"        : "Fuids_09",
                "postprocess_parameters" : {
                    "result_file_configuration" : {
                        "gidpost_flags"               : {
                            "GiDPostMode"           : "GiD_PostBinary",
                            "WriteDeformedMeshFlag" : "WriteDeformed",
                            "WriteConditionsFlag"   : "WriteConditions",
                            "MultiFileFlag"         : "MultipleFiles"
                        },
                        "file_label"                  : "time",
                        "output_control_type"         : "time",
                        "output_interval"             : 0.1,
                        "body_output"                 : true,
                        "node_output"                 : false,
                        "skin_output"                 : false,
                        "plane_output"                : [],
                        "nodal_results"               : ["VELOCITY","PRESSURE","DISTANCE","LIN_DARCY_COEF","NONLIN_DARCY_COEF","POROSITY","BODY_FORCE"],
                        "gauss_point_results"         : [],
                        "nodal_nonhistorical_results" : []
                    },
                    "point_data_configuration"  : []
                },
                "output_name"            : "gid_output/Fuids_09"
            }
        }],
        "vtk_output" : [{
            "python_module" : "vtk_output_process",
            "kratos_module" : "KratosMultiphysics",
            "process_name"  : "VtkOutputProcess",
            "Parameters"    : {
                "model_part_name"                             : "Fuids_09",
                "output_control_type"                         : "time",
                "output_interval"                             : 0.1,
                "file_format"                                 : "ascii",
                "output_precision"                            : 7,
                "output_sub_model_parts"                      : false,
                "output_path"                                 : "vtk_output",
                "save_output_files_in_folder"                 : true,
                "nodal_solution_step_data_variables"          : ["VELOCITY","PRESSURE","DISTANCE","LIN_DARCY_COEF","NONLIN_DARCY_COEF","POROSITY","BODY_FORCE"],
                "nodal_data_value_variables"                  : [],
                "element_data_value_variables"                : [],
                "condition_data_value_variables"              : [],
                "gauss_point_variables_extrapolated_to_nodes" : []
            }
        }]
    },
    "solver_settings"  : {
        "model_part_name"             : "Fuids_09",
        "domain_size"                 : 3,
        "max_safety_factor"             : 1e-1,
        "max_time_step_size"            : 1e-2,
        "density"                       : 1e3,
        "viscosity"                     : 1e-6,
        "wall_law_y"                    : 0.0,
        "use_mass_correction"           : true,
        "redistance_frequency"          : 5,
        "extrapolation_layers"          : 5,
        "number_of_initial_time_steps"  : 10,
        "initial_time_step_size"        : 1e-5,
        "reduction_on_failure"          : 3e-1,
        "stabdt_pressure_factor"        : 1e0,
        "stabdt_convection_factor"      : 1e-2,
        "tau2_factor"                   : 1e0,
        "assume_constant_pressure"      : false,
        "compute_porous_resistance_law" : "NONE",
        "echo_level"                    : 0,
        "solver_type" : "EdgebasedLevelset",
        "linear_solver_settings"      : {
            "solver_type"         : "amgcl"
        },
        "model_import_settings"       : {
            "input_type"     : "mdpa",
            "input_filename" : "Fuids_09"
        }
    },
    "processes"        : {
        "initial_conditions_process_list"  : [{
            "python_module" : "assign_scalar_variable_process",
            "kratos_module" : "KratosMultiphysics",
            "process_name"  : "AssignScalarVariableProcess",
            "Parameters"    : {
                "model_part_name" : "Fuids_09.GENERIC_Add_SubModelPart_Auto1",
                "variable_name"   : "DISTANCE",
                "constrained"     : false,
                "value"           : -1.0,
                "interval"        : [0.0,0.0]
	   }
        },{
            "python_module" : "assign_scalar_variable_process",
            "kratos_module" : "KratosMultiphysics",
            "process_name"  : "AssignScalarVariableProcess",
            "Parameters"    : {
                "model_part_name" : "Fuids_09.GENERIC_Add_SubModelPart_Auto2",
                "variable_name"   : "DISTANCE",
                "constrained"     : false,
                "value"           : -1.0,
                "interval"        : [0.0,0.0]
            }
        }],
        "boundary_conditions_process_list" : [{
            "python_module" : "assign_scalar_variable_process",
            "kratos_module" : "KratosMultiphysics",
            "process_name"  : "AssignScalarVariableProcess",
            "Parameters"    : {
                "mesh_id"         : 0,
                "model_part_name" : "Fuids_09.GENERIC_Add_SubModelPart_Auto2",
                "variable_name"   : "LIN_DARCY_COEF",
                "constrained"     : false,
                "value"           : 3000
            }
	},{
            "python_module" : "assign_scalar_variable_process",
            "kratos_module" : "KratosMultiphysics",
            "process_name"  : "AssignScalarVariableProcess",
            "Parameters"    : {
                "mesh_id"         : 0,
                "model_part_name" : "Fuids_09.GENERIC_Add_SubModelPart_Auto2",
                "variable_name"   : "NONLIN_DARCY_COEF",
                "constrained"     : false,
                "value"           : 8000
            }
	},{
            "python_module" : "assign_scalar_variable_process",
            "kratos_module" : "KratosMultiphysics",
            "process_name"  : "AssignScalarVariableProcess",
            "Parameters"    : {
                "mesh_id"         : 0,
                "model_part_name" : "Fuids_09.GENERIC_Add_SubModelPart_Auto2",
                "variable_name"   : "POROSITY",
                "constrained"     : false,
                "value"           : 0.5
            }
        },{
            "python_module" : "apply_inlet_process",
            "kratos_module" : "KratosMultiphysics.FluidDynamicsApplication",
            "process_name"  : "ApplyInletProcess",
            "Parameters"    : {
                "model_part_name" : "Fuids_09.AutomaticInlet3D_Automatic_inlet_velocity_Auto1",
                "variable_name"   : "VELOCITY",
                "constrained"     : true,
                "interval"        : [0.0,"End"],
                "modulus"         : 1,
                "direction"       :[1.0,0.0,0.0]
            }
        },{
            "python_module" : "apply_outlet_process",
            "kratos_module" : "KratosMultiphysics.FluidDynamicsApplication",
            "process_name"  : "ApplyOutletProcess",
            "Parameters"    : {
                "model_part_name"    : "Fuids_09.Outlet3D_Outlet_pressure_Auto1",
                "variable_name"      : "PRESSURE",
                "constrained"        : true,
                "value"              : 0.0,
                "hydrostatic_outlet" : false,
                "h_top"              : 0.0
            }
        },{
            "python_module" : "apply_slip_process",
            "kratos_module" : "KratosMultiphysics.FluidDynamicsApplication",
            "process_name"  : "ApplySlipProcess",
            "Parameters"    : {
                 "model_part_name" : "Fuids_09.Slip3D"
            }
        }],
        "gravity"                          : [{
            "python_module" : "assign_vector_by_direction_process",
            "kratos_module" : "KratosMultiphysics",
            "process_name"  : "AssignVectorByDirectionProcess",
        "Parameters"    : {
                "model_part_name" : "Fuids_09",
                "variable_name"   : "BODY_FORCE",
                "modulus"         : 9.81,
                "constrained"     : false,
                "direction"       : [0.0,0.0,-1.0]
        }
        }],
        "auxiliar_process_list"            : []
    }
}

@jgonzalezusua
Copy link
Copy Markdown
Member

Hi @jginternational, I am not a developer of the FreeSurface application but the FluidDEM, are you sure that you need my review?

@jginternational jginternational requested review from joaquinirazabal and removed request for jgonzalezusua June 28, 2022 09:48
@jginternational
Copy link
Copy Markdown
Member Author

Hi @jginternational, I am not a developer of the FreeSurface application but the FluidDEM, are you sure that you need my review?

Sorry, my fault. I need some hollidays

@joaquinirazabal
Copy link
Copy Markdown
Member

Hi @jginternational, thanks for creating this branch so quick.
Regarding the issue about the names (Lin_Darcy_Coef and NoLin_Darcy_Coef) we can use Linear Darcy coefficient and Non-linear Darcy coefficient.
About the fact that materials are not assigned to parts, it is something that we have to improve in the future. Now, density and viscosity are specified in the solver settings...
This morning I sent you an example that runs is the master branch of Kratos, is it enough with that example?

@joaquinirazabal
Copy link
Copy Markdown
Member

Hi, @jginternational, I saw that you include the FreeSurface in the Fluid applications window. It looks great, but let's ask @rubenzorrilla if they want it there or in the main window outside the Fluid applications window.

image

What do you think, @rubenzorrilla?

@rubenzorrilla
Copy link
Copy Markdown
Member

Hi, @jginternational, I saw that you include the FreeSurface in the Fluid applications window. It looks great, but let's ask @rubenzorrilla if they want it there or in the main window outside the Fluid applications window.

image

What do you think, @rubenzorrilla?

Hey! No problem from my side. Actually, I think it makes sense 👍 .

@joaquinirazabal
Copy link
Copy Markdown
Member

Hi, @jginternational, have you made any progress on this issue? Do you need anything from our side?

@jginternational
Copy link
Copy Markdown
Member Author

Hi @joaquinirazabal

you can try the app

You can also try the 2D example I've created based on your model. It is not properly calibrated.

image

@joaquinirazabal
Copy link
Copy Markdown
Member

Thank you very much, @jginternational! I will take a look.

@joaquinirazabal
Copy link
Copy Markdown
Member

I pushed some changes to solve some errors I found. Do you think they are correct, @jginternational?

There are two other problems that I don't know why they occur:

  1. I can not see the image of the example:
    image

  2. This is maybe my fault, but I have this issue when I run the problem directly from GiD (from terminal it works properly)
    image

Thanks

@jginternational
Copy link
Copy Markdown
Member Author

Well, the first point is fixed now. It was a typo in the name of the icon (windows is case unsensitive so it's difficult to notice)

The second one indicates that you are trying to run using the pip packages deployed, and Free Surface is not in the deploy yet.

Using Kratos preferences you can switch the Launch mode. Set it to 'Local Compiled' to run using your compilation, that must be placed in kratos.gid/exec/runkratos (as always)

@joaquinirazabal
Copy link
Copy Markdown
Member

Now it is working great, thanks @jginternational. I changed some things in the example to make it work better.
What I could not do is setting the gravity to 9.81 by default (now is 0) in the application and the output type to time (better than to step).

@jginternational jginternational marked this pull request as ready for review August 8, 2022 15:02
@jginternational
Copy link
Copy Markdown
Member Author

Once you aprove it, I will merge it.

It would be interesting to add a 3D example also

Copy link
Copy Markdown
Member

@joaquinirazabal joaquinirazabal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge it. Once I am back from my holidays, I will prepare a 3D example. Thank you, @jginternational

@jginternational jginternational merged commit 474e3f3 into master Aug 9, 2022
@jginternational jginternational deleted the add/freesurface branch August 9, 2022 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants