Kratos icon indicating copy to clipboard operation
Kratos copied to clipboard

[Fluid] Standarize buffer filling

Open rubenzorrilla opened this issue 3 years ago • 11 comments

📝 Description This PR (finally) makes the buffer filling of the FluidDynamicsApplication solvers properly, that is to say à la StructuralMechanicsApplication. As you note, what we basically do is to go backwards such that we do enough "fake" CloneSolutionStep operations instead of dropping the initial steps until the buffer is filled as we've done so far (see the function _SetAndFillBuffer in the fluid_solver.py). Thanks to this we're starting the simulations at time step one, which is what the user expects. On top of this, this makes possible the usage of buffer > 2 time schemes in the CFD ROM.

(as we're solving an "extra" time step, this required to slightly modify our current test values...)

PD: initialize_with_compressible_potential_flow_process_testis the unique test failing. @EduardGomezEscandell will take care of it. Creating the PR to start triggering the CI.

PD2: @KratosMultiphysics/pfem2 and @KratosMultiphysics/shallow-water also use the dropping step(s) bad practice. I think it will be positive to do what we're doing in here.

rubenzorrilla avatar Feb 01 '22 17:02 rubenzorrilla

hm this will probably also change many other test results for sure the ones in CoSim and MeshMoving (=> ale-fluid solver)

philbucher avatar Feb 01 '22 18:02 philbucher

hm this will probably also change many other test results for sure the ones in CoSim and MeshMoving (=> ale-fluid solver)

Potentially yes.

rubenzorrilla avatar Feb 02 '22 08:02 rubenzorrilla

Hello Rubén, I'll deal with the PFEM2Application over the weekend. Thanks for your feedback. Regards

dcagritan avatar Feb 02 '22 09:02 dcagritan

Be careful. Some time ago I tried the same in the ShallowWaterApp, but I faced some problems with the initial time. I think you're reading the initial time at the PrepareModelPart but the time is not set. #9267 is related to that

miguelmaso avatar Feb 02 '22 10:02 miguelmaso

Great! Thank you @miguelmaso! Regards

dcagritan avatar Feb 02 '22 10:02 dcagritan

@miguelmaso @dcagritan My comment was only for letting you know. Non-core application changes must be done in a different PR.

rubenzorrilla avatar Feb 02 '22 13:02 rubenzorrilla

@rubenzorrilla, yes, I'm aware of that. Thanks for letting me know! Good day

dcagritan avatar Feb 02 '22 13:02 dcagritan

Issues with Swimming DEM application are handled in #10179. About the fluid adjoint analysis stuff, we're (@sunethwarna) are discussing the best way to get rid of the nsteps in problem_data section and the negative time step.

rubenzorrilla avatar Aug 22 '22 15:08 rubenzorrilla

I will get rid of the nsteps in the ajoints and will have usual start_time and end_time in problem_data. We don't have a problem with the problem_data section and the negative time step ryt? It is set at the solver_settings part.

sunethwarna avatar Aug 22 '22 16:08 sunethwarna

I will get rid of the nsteps in the ajoints and will have usual start_time and end_time in problem_data. We don't have a problem with the problem_data section and the negative time step ryt? It is set at the solver_settings part.

As we discussed yesterday, I'd avoid a negative time step, as it is in my opinion a bit counterintuitive for the user (note that current CI error comes indeed from a check that ensures exactly this). Instead I'd modify the _ComputeDeltaTime in the AdjointFluidSolver to put the minus under the hood, so the user (or the GUI) doesn't need to do anything special.

rubenzorrilla avatar Aug 23 '22 09:08 rubenzorrilla

I will get rid of the nsteps in the ajoints and will have usual start_time and end_time in problem_data. We don't have a problem with the problem_data section and the negative time step ryt? It is set at the solver_settings part.

As we discussed yesterday, I'd avoid a negative time step, as it is in my opinion a bit counterintuitive for the user (note that current CI error comes indeed from a check that ensures exactly this). Instead I'd modify the _ComputeDeltaTime in the AdjointFluidSolver to put the minus under the hood, so the user (or the GUI) doesn't need to do anything special.

@sunethwarna any advance in this regard? I don't mind taking care of the suggested changes.

rubenzorrilla avatar Sep 09 '22 08:09 rubenzorrilla

Required changes in the adjoint were done in #10312.

rubenzorrilla avatar Sep 30 '22 12:09 rubenzorrilla

@rubenzorrilla did you run all the tests in the CoSimApp? I am afraid this can affect it too

FYI @mpentek this might affect some results

philbucher avatar Sep 30 '22 21:09 philbucher

@rubenzorrilla did you run all the tests in the CoSimApp? I am afraid this can affect it too

FYI @mpentek this might affect some results

Aren't these run by the CI?

rubenzorrilla avatar Oct 01 '22 17:10 rubenzorrilla

only the very small FSI tests are run in the CI However since coupled sims usually run longer they are part of the validation suite

Can you hence please run all tests? I thought for bigger changes such as this it was the responsibility of the dev to run the tests and not only rely on the CI?

philbucher avatar Oct 02 '22 15:10 philbucher

only the very small FSI tests are run in the CI However since coupled sims usually run longer they are part of the validation suite

Can you hence please run all tests? I thought for bigger changes such as this it was the responsibility of the dev to run the tests and not only rely on the CI?

OK. No problem, I'll run them again. Indeed, I think I ran all of them when amending the SDOF test results.

rubenzorrilla avatar Oct 03 '22 09:10 rubenzorrilla

only the very small FSI tests are run in the CI However since coupled sims usually run longer they are part of the validation suite Can you hence please run all tests? I thought for bigger changes such as this it was the responsibility of the dev to run the tests and not only rely on the CI?

OK. No problem, I'll run them again. Indeed, I think I ran all of them when amending the SDOF test results.

Seems that all the tests are OK. :+1:

rubenzorrilla avatar Oct 03 '22 11:10 rubenzorrilla

Merging. Just to be sure again, I ran all the fluid-related tests (conv-diff, potential flow, FSI, co-sim, rans, etc...).

rubenzorrilla avatar Oct 11 '22 08:10 rubenzorrilla