Chrono & MDBC: Difference between forces from "ComputeForces function" and "ChronoBody_forces.csv"
Hello,
I have a question with regards to the output of forces from the "ComputeForces function" and the forces
in "ChronoBody_forces.csv".
I am currently simulating the "DualSPHysics_v5.2/examples/mdbc/04_Dambreak/" dam break problem
(with MDBC) but changing the case so that,
*The obstacle is a floating body with MDBCs
*The obstacle has a linearSpring and linearConstraint implemented through Chrono, so that the obstacle vibrates in the direction of the flow.
*The friction constant between the obstacle and the flume bottom is zero, so that the force acting on the obstacle in the direction of the flow is the spring force and the fluid force from the dam break. Thus the equation of motion for the obstacle is M*acc+K*(pos-pos_initial)=F_fluidforce.
I believe that the results from the forces from the "ComputeForces function" and the forces
in "ChronoBody_forces.csv" should be the same but am getting contradictory results.
Below I have plotted the force from, 1. ChronoBodyForces.csv, 2. ComputeForces. Using the info from "FloatingMotion_mk64.csv", by extracting the acceleration and position I have also computed the quantity, 3. M*acc+K*(pos-pos_initial) . Here I am using the Verlet Scheme. One can see that 1 and 3 match, but ComputeForces has a larger value. 4. is the force obtained from the 04_DamBreak case without obstacle motion.
The problem persists even for the case of using the Symplectic scheme as shown below.
I have looked through the DualSPHysics source code, but since I do not have access to the source code for the "ComputeForces" and do not have access to the source code to the ChronoSPH interface which is precomplied into the libdsphchrono.so library, I have not been able to figure out the problem.
I am suspecting that there is an issue in computed the forces. I have attached the file used to generate the results above.
Any help or insight into the reason the forces do not match would be greatly appreciated.
Thank you very much in advance.
Debug Trace
Notice |
rich is deprecated. Use FormatService::renderHtml($content, Formats\RichFormat::FORMAT_KEY) instead. #0 [internal function]: gdn_ErrorHandler(16384, 'rich is depreca...', '/var/www/forums...', 950, Array) #1 /var/www/forums-dual-sphysics-org/library/core/functions.general.php(950): trigger_error('rich is depreca...', 16384) #2 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1729): deprecated('rich', 'FormatService::...') #3 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1479): Gdn_Format::rich('[{"insert":"Hel...') #4 /var/www/forums-dual-sphysics-org/applications/vanilla/controllers/class.discussioncontroller.php(197): Gdn_Format::to('[{"insert":"Hel...', 'Rich') #5 /var/www/forums-dual-sphysics-org/library/core/class.dispatcher.php(862): DiscussionController->index('2679', 'chrono-mdbc-dif...', '') #6 /var/www/forums-dual-sphysics-org/library/core/class.dispatcher.php(279): Gdn_Dispatcher->dispatchController(Object(Gdn_Request), Array) #7 /var/www/forums-dual-sphysics-org/index.php(29): Gdn_Dispatcher->dispatch() #8 {main} |
Notice |
rich is deprecated. Use FormatService::renderHtml($content, Formats\RichFormat::FORMAT_KEY) instead. #0 [internal function]: gdn_ErrorHandler(16384, 'rich is depreca...', '/var/www/forums...', 950, Array) #1 /var/www/forums-dual-sphysics-org/library/core/functions.general.php(950): trigger_error('rich is depreca...', 16384) #2 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1729): deprecated('rich', 'FormatService::...') #3 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1479): Gdn_Format::rich('[{"insert":"Hel...') #4 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/helper_functions.php(24): Gdn_Format::to('[{"insert":"Hel...', 'Rich') #5 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/discussion.php(89): formatBody(Object(stdClass)) #6 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/index.php(31): include('/var/www/forums...') #7 /var/www/forums-dual-sphysics-org/library/core/class.controller.php(778): include('/var/www/forums...') #8 /var/www/forums-dual-sphysics-org/library/core/class.controller.php(1382): Gdn_Controller->fetchView('', false, false) #9 /var/www/forums-dual-sphysics-org/library/core/class.pluggable.php(217): Gdn_Controller->xRender() #10 /var/www/forums-dual-sphysics-org/applications/vanilla/controllers/class.discussioncontroller.php(310): Gdn_Pluggable->__call('render', Array) #11 /var/www/forums-dual-sphysics-org/library/core/class.dispatcher.php(862): DiscussionController->index('2679', 'chrono-mdbc-dif...', '') #12 /var/www/forums-dual-sphysics-org/library/core/class.dispatcher.php(279): Gdn_Dispatcher->dispatchController(Object(Gdn_Request), Array) #13 /var/www/forums-dual-sphysics-org/index.php(29): Gdn_Dispatcher->dispatch() #14 {main} |
Notice |
rich is deprecated. Use FormatService::renderHtml($content, Formats\RichFormat::FORMAT_KEY) instead. #0 [internal function]: gdn_ErrorHandler(16384, 'rich is depreca...', '/var/www/forums...', 950, Array) #1 /var/www/forums-dual-sphysics-org/library/core/functions.general.php(950): trigger_error('rich is depreca...', 16384) #2 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1729): deprecated('rich', 'FormatService::...') #3 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1479): Gdn_Format::rich('[{"insert":"In ...') #4 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/helper_functions.php(24): Gdn_Format::to('[{"insert":"In ...', 'Rich') #5 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/helper_functions.php(170): formatBody(Object(stdClass)) #6 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/comments.php(19): writeComment(Object(stdClass), Object(DiscussionController), Object(Gdn_Session), 1) #7 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/index.php(53): include('/var/www/forums...') #8 /var/www/forums-dual-sphysics-org/library/core/class.controller.php(778): include('/var/www/forums...') #9 /var/www/forums-dual-sphysics-org/library/core/class.controller.php(1382): Gdn_Controller->fetchView('', false, false) #10 /var/www/forums-dual-sphysics-org/library/core/class.pluggable.php(217): Gdn_Controller->xRender() #11 /var/www/forums-dual-sphysics-org/applications/vanilla/controllers/class.discussioncontroller.php(310): Gdn_Pluggable->__call('render', Array) #12 /var/www/forums-dual-sphysics-org/library/core/class.dispatcher.php(862): DiscussionController->index('2679', 'chrono-mdbc-dif...', '') #13 /var/www/forums-dual-sphysics-org/library/core/class.dispatcher.php(279): Gdn_Dispatcher->dispatchController(Object(Gdn_Request), Array) #14 /var/www/forums-dual-sphysics-org/index.php(29): Gdn_Dispatcher->dispatch() #15 {main} |
Notice |
rich is deprecated. Use FormatService::renderHtml($content, Formats\RichFormat::FORMAT_KEY) instead. #0 [internal function]: gdn_ErrorHandler(16384, 'rich is depreca...', '/var/www/forums...', 950, Array) #1 /var/www/forums-dual-sphysics-org/library/core/functions.general.php(950): trigger_error('rich is depreca...', 16384) #2 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1729): deprecated('rich', 'FormatService::...') #3 /var/www/forums-dual-sphysics-org/library/core/class.format.php(1479): Gdn_Format::rich('[{"insert":{"em...') #4 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/helper_functions.php(24): Gdn_Format::to('[{"insert":{"em...', 'Rich') #5 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/helper_functions.php(170): formatBody(Object(stdClass)) #6 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/comments.php(19): writeComment(Object(stdClass), Object(DiscussionController), Object(Gdn_Session), 2) #7 /var/www/forums-dual-sphysics-org/applications/vanilla/views/discussion/index.php(53): include('/var/www/forums...') #8 /var/www/forums-dual-sphysics-org/library/core/class.controller.php(778): include('/var/www/forums...') #9 /var/www/forums-dual-sphysics-org/library/core/class.controller.php(1382): Gdn_Controller->fetchView('', false, false) #10 /var/www/forums-dual-sphysics-org/library/core/class.pluggable.php(217): Gdn_Controller->xRender() #11 /var/www/forums-dual-sphysics-org/applications/vanilla/controllers/class.discussioncontroller.php(310): Gdn_Pluggable->__call('render', Array) #12 /var/www/forums-dual-sphysics-org/library/core/class.dispatcher.php(862): DiscussionController->index('2679', 'chrono-mdbc-dif...', '') #13 /var/www/forums-dual-sphysics-org/library/core/class.dispatcher.php(279): Gdn_Dispatcher->dispatchController(Object(Gdn_Request), Array) #14 /var/www/forums-dual-sphysics-org/index.php(29): Gdn_Dispatcher->dispatch() #15 {main} |
Comments
In following up on the issue above, I have been able to find out that the problem seems to lie in the use of MDBC boundary condition.
If I turn MDBC off in the analysis, the forces from 1,2,3 match. Thus the problem may line in how the MDBC boundary conditions are handled in the evaluation of the forces acting on floating bodies. The figure below shows the case where MDBC is turned off and the Verlet scheme is used. The case using the symplectic scheme gives similar results to the Verlet scheme.
It would help if I could get a fix for the code or get access to the ComputeForces function source code so that I can try to fix the problem myself.
Thank you very much in advance.
Amazing find, thank you for highlighting. I believe I have unfortunately experienced the same issue in the past. I hope @Alex or someone else from the DualSPHysics team can chime in
Kind regards