Hi,
I keep playing with scripting ) I tried scripted liquid (Standard Particles/type: script) and found something confusing. There is a "def computeInternalForces( emitter ):" section in a Script editor. So, I compute internal forces there, but how I suppose to utilize them? I mean there is only setExternalForce() function which is obviously for External forces. What should I do to apply calculated force to a particle? Should I just calculate velocity and new position from a new internal force and apply them to a particle via setVelocity() and setPosition()? Or, there is a way to apply internal force to each particle?
PC: it would be nice to have some simple tutorials about scripted particles
thanks,
Andrey
Scripted Liquid (internal force)
-
- Posts: 178
- Joined: Tue Aug 29, 2017 12:35 pm
Re: Scripted Liquid (internal force)
Yes, that's possible and to use it you have to change the standard emitter's fluid type: Node Params > Particles > Type > Script. Then you click on the "Edit" button below to open the associated scripting editor.Or, there is a way to apply internal force to each particle?
It works in the same way as setExternalForce: you loop through the particles and apply the internal force. There used to be an example for internal forces somewhere, but I couldn't find it anymore. I know there's a C++ source code in RF's program folder (sdk > examples > surface_tension > src > surface_tension.cpp). Maybe this will help you.
Re: Scripted Liquid (internal force)
Yes, that is how I do it Thank you for mentioning C++ source code. It was really helpful. Now I see that there is a function setInternalForce(), which is somehow not presented in a list of Python's functions in the Help documentation.
Now I have another question )) Well, I'm a C++ guy (mostly I worked on EM simulations last few years), so working in C++ is preferable for me. How can I use C++ in Realflow?
My apologies for late response. I'm very busy nowadays.
Thank you,
Andrey
Now I have another question )) Well, I'm a C++ guy (mostly I worked on EM simulations last few years), so working in C++ is preferable for me. How can I use C++ in Realflow?
My apologies for late response. I'm very busy nowadays.
Thank you,
Andrey
-
- Posts: 178
- Joined: Tue Aug 29, 2017 12:35 pm
Re: Scripted Liquid (internal force)
Sorry for my late reply, but I've simply overseen your answer.
There's a C++ manual under C:\Program Files\Next Limit\RealFlow 10\sdk\doc\manual. It contains how to use C++ with RF, build a developement environment, create and compile the different plugin types, and place them inside RF to make them work.
There's a C++ manual under C:\Program Files\Next Limit\RealFlow 10\sdk\doc\manual. It contains how to use C++ with RF, build a developement environment, create and compile the different plugin types, and place them inside RF to make them work.