KratosMultiphysics / Kratos

Kratos Multiphysics (A.K.A Kratos) is a framework for building parallel multi-disciplinary simulation software. Modularity, extensibility and HPC are the main objectives. Kratos has BSD license and is written in C++ with extensive Python interface.
https://kratosmultiphysics.github.io/Kratos/
Other
1.03k stars 245 forks source link

Changes in FluidDynamicsApplicacion for using it with ROM #7293

Open Rbravo555 opened 4 years ago

Rbravo555 commented 4 years ago

Description As discussed, if the same ROM workflow used for structural problems is employed for FluidDynamics, there are some considerations regarding the hyper-reduced order model HROM, .

In this scenario there are some conditions with no assigned element (due to the element selection algorithm used). Therefore, the check on "applications/FluidDynamicsApplication/python_scripts/check_and_prepare_model_process_fluid.py" throws an error.

Is it possible to have a flag that skips automatically this check for ROM models? The check also performs some other tasks like the re-orientation of the normals, should they be inverted.

Additional info LW_HROM

rubenzorrilla commented 1 year ago

@Rbravo555 which is the status of this? I think we fixed some of the issues at some point but not sure if all of them...

Rbravo555 commented 1 year ago

HHROM_Fluid

As of now, if one uses the serial workflow implemented using the RomAnalysis, the created hyper-reduced model part (using the hrom_training_utility.py line 72: CreateHRomModelParts() ) is not readily usable.

The following problems remain:

I came up with a simple fix for the second point as follows: In hrom_training_utility.py, line 72: CreateHRomModelParts(), rather than using the model part of the simulation to create the new model part, use instead the ModelPartIO to read the mdpa file, and from that fresh modelpart, generate the HROM model part which of course does not contain any properties.

For structural mechanics simulations, this naive fix allowed to use the HROM model part as shwon next: PhilipaHROM

Rbravo555 commented 1 year ago

The fluid case can be found here

rubenzorrilla commented 1 year ago

Thanks for the update @Rbravo555. I'll try to take care ASAP.

rubenzorrilla commented 1 year ago

About the assign_vector_by_direction_process.py one I think that it is what is is, that is to say, we cannot ensure that it behaves well in the HROM context if the inwards or outwards automatic detection are used. The point is that it uses the conditions in the model part to calculate the average normal, if there are no conditions, the normal is OFC zero. Also note that in the case that there are some conditions in the HROM model part, the average normal of the FOM simulation and the HROM one wouldn't be the same, so we would be imposing different BCs. In order to use this process in the HROM context we need to ask for an array direction to the user, something that it is already supported. Note that this propagates to the inlet process in the FluidDynamicsApplication.

@KratosMultiphysics/technical-committee maybe we should consider adding a bool type variable (e.g. IS_HROM) to throw meaningful errors in these cases.

About the properties issue, I think we can circumvent it without parsing the mdpa twice (note that this might take a while in large scale models). I'll try to figure out a way, but should be as easy as adding only the properties that are to be used in the HROM model part instead of all the properties in the origin model part.