DualSPHysics / DesignSPHysics

Module for FreeCAD intended to use with DualSPHysics fluid simulator.
Other
111 stars 40 forks source link

Constant B Cannot be Zero. #179

Closed SohailAusgur closed 9 months ago

SohailAusgur commented 9 months ago

Hi,

1) I'm trying to learn DualSPH. I am running this simulation or trying to in this case. But i keep getting this error as seen below, The simulation I am running is https://www.youtube.com/watch?v=xZyEG5jLPIg&t=496s

And in that simulation, the B constant was left as 0, however this is the issue I am getting.

Please advise on a solution.

2)Also, In the video, one of the Parameters is enabling DeltaSPH, however I do not have this option in my Execution Parameters. Please explain what this is.

Many Thanks for you Support.

Error Below:

Copyright (c) 2023 by Dr Jose M. Dominguez Alonso, Dr Alejandro Crespo, Prof. Moncho Gomez Gesteira, Prof. Benedict Rogers, Dr Georgios Fourtakas, Prof. Peter Stansby, Dr Renato Vacondio, Dr Corrado Altomare, Dr Angelo Tafuni, Dr Orlando Garcia Feal, Ivan Martinez Estevez, Dr Joseph O'Connor, Dr Aaron English EPHYSLAB Environmental Physics Laboratory, Universidade de Vigo School of Mechanical, Aerospace and Civil Engineering, University of Manchester DualSPHysics is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. DualSPHysics is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with DualSPHysics. If not, see . Free download source files and documentation from DualSPHysics website (http://dual.sphysics.org). Full list of developers and contributors is available at https://dual.sphysics.org/developers Properly cite the use of DualSPHysics (Dominguez et al., 2022) (https://dual.sphysics.org/references). DualSPHysics5 v5.2.272 (12-06-2023) ==================================== Threads by host for parallel execution: 12 [Initialising JSphCpuSingle 25-02-2024 19:08:25] ProgramFile=".../dualsphysics/bin/DualSPHysics5.2_win64.exe" ExecutionDir=".../FreeCAD/Mod/DesignSPHysics" XmlFile=".../box/box_out/box.xml" OutputDir=".../dualsphcases/box/box_out" OutputDataDir=".../dualsphcases/box/box_out" XML-App: GenCase v5.0.278c (30-10-2023) XML-Vars (uservars + ctes): MResId=[0] CaseName=["box"] Data2D=[1] Data2DPosy=[0] H=[0.0212132] KernelSize=[0.0424264] B=[0] Gamma=[7] Rhop0=[1000] Dp=[0.0125] Gravity_x=[0] Gravity_y=[0] Gravity_z=[0] MassFluid=[0.15625] MassBound=[0.15625] XML-Vars (parameters): TimeMax=[6] TimeOut=[0.02] **Basic case configuration is loaded **Special case configuration is loaded Loading initial state of particles... Loaded particles: 38801 MapRealPos(border)=(-1.50625,-0.00106066,-0.00106066)-(1.50625,0.00106066,2.00106) MapRealPos(final)=(-1.50625,-0.00106066,-0.00106066)-(1.50625,0.00106066,2.00106) **Initial state of particles is loaded **2D-Simulation parameters: CaseName="box" RunName="box" Simulate2DPosY=0 Symmetry=False SavePosDouble=True SvExtraParts="" SaveFtAce=False SvTimers=True Boundary="DBC" StepAlgorithm="Symplectic" Kernel="Wendland" Wendland.awen=1237.778 Wendland.bwen=-291768 Viscosity="Artificial" Visco=0.01 ViscoBoundFactor=1 DensityDiffusion="None" Shifting="None" RigidAlgorithm="None" FloatingCount=0 CaseNp=38801 CaseNbound=38801 CaseNfixed=38801 CaseNmoving=0 CaseNfloat=0 CaseNfluid=0 PeriodicActive="Axis-X" PeriodicXinc=(-3.0125,0,0) Dp=0.0125 KernelH=0.021213 (CoefficientH=1.2; H/Dp=1.69706) KernelSize=0.04242641 CteB=0 Gamma=7 RhopZero=1000 Cs0=0 CFLnumber=0.2 DtIni=inf DtMin=inf DtAllParticles=False MassFluid=0.15625 MassBound=0.15625 TimeMax=6 TimePart=0.02 Gravity=(0,0,0) NpMinimum=38801 RhopOut=True RhopOutMin=700 RhopOutMax=1300 WrnPartsOut=True *** Exception (JSphCpuSingle::VisuConfig) at DualSPHysics/source/JSph.cpp:1608 Text: Constant 'b' cannot be zero. 'b' is zero when fluid height is zero (or fluid particles were not created) Finished execution (code=1).
imestevez commented 9 months ago

This error means that no fluid was created. Note that in the new version of DualSPHysycs the density diffusion treatment is handled with the options:

More information available in the reference paper: Domínguez, J. M., Fourtakas, G., Altomare, C., Canelas, R. B., Tafuni, A., García-Feal, O., Martínez-Estévez, I., Mokos, A., Vacondio, R., Crespo, A. J. C., Rogers, B. D., Stansby, P. K., & Gómez-Gesteira, M. (2022). DualSPHysics: From fluid dynamics to multiphysics problems. Computational Particle Mechanics, 9(5), 867–895. https://doi.org/10.1007/s40571-021-00404-2

SohailAusgur commented 9 months ago

Hi,

I did that and it seems to work. However i was getting Particles moving out of the Case Limits in my +Z direction and had to make Physical shape to extend the case limits as using the +10% in the Minimum Boundaries in the Simulation Domain gives me an error.

Is there a way to make simulation to keep the Case Limits stated without having to use physical boundaries?

imestevez commented 9 months ago

You can use Execution Parameters->Simulation Domain -> Increase the maximum Z size by X % (typycally 50%). Using this option forces the domain to increase even if there are no boundary particles at that new limit domain.

SohailAusgur commented 9 months ago

Thank you for the help!

Much Appreciated.