Compute fluid accellaration
Hi all,
How can I compute the fluid acceleration from the velocity field? Or in other words I want to calculate the material derivative of the velocity vector field. |
|
Hi Alexey,
Thanks for you quick reply. I take it from your answer that one has to write a custom application to compute the material derivative. I am not really familiar with OpenFOAM programming. Is there no way to calculate the material derivative with probe functions or in Paraview? |
Hi,
There is codedFunctionObject and in your case it could be as simple as Code:
acceleration |
Hi Alexey,
Thanks for the code. I added the code to my controlDict in the functions section. With OF3.0+ I got a fatal error: Code:
--> FOAM FATAL ERROR: Any thoughts on these issues will be much appreciated. |
A further update. I managed to run the code with OF3+. Some changes were necessary.
Code:
acceleration |
Is DDt(U) written on every time step? Add this:
Code:
writeControl writeTime; Code:
acceleration |
Hi Alexey,
I tried to compile OF4.1 but run into errors, so I couldn't test your code. However, I managed to get a solution in OF3+ and OF1612+. For OF3+ this is my controlDict: Code:
/*--------------------------------*- C++ -*---------------------------------*\ Code:
/*--------------------------------*- C++ -*---------------------------------*\ I am wondering if it is possible to write DDtU for a probe location? |
You can:
1. Use probes function object. I think with correct order in functions dictionary it is possible to first write DDt(U) field and then probe it. 2. Use probes object directly in your coded function object. Though this way requires a little be more code, than just to write DDt(U). |
Hi,
I ended up with the following implementation: https://github.com/mrklein/foam-case...ontrolDict#L43. I have tested it on OF 4.x, so maybe it needs adaptation for OF+3.0 and OF+1602. |
Hi Alexey,
I managed to install OF4.1 and your code works very well. It also works in OF1612+ as is. Now I tried to read the probe locations from a file in the system subfolder. I used the following code, but results in errors. Code:
acceleration Code:
probeLocations |
Hi,
I have updated example (https://github.com/mrklein/foam-case...e-acceleration) with the following additions: 1. Added examples for creation of probes from probesDict file and probes sub-dictionary of controlDict. 2. To be able to probe acceleration field every time step and to write it every write time, I have moved probing code to execute method. So now write frequency is controlled by writeControl and probe frequency with executeControl. 3. Got rid of field lookups on every write/execute method call. Tested it on OpenFOAM 4.x, do not know if it works on other FOAMs. |
Quote:
I am looking for a function object so that I can calculate the acceleration field when running OpenFOAM as well. To me, it doesn't look like the code in the github link calculates the material derivative. Where is the dot product of the velocity and velocity gradient in the code? I also ran the code with some updates to suit OpenFOAM 1912 but it doesn't save anything in the postProcessing folder. It doesn't save anything in the time folders as well. Is someone able to help me with these please? This is the code I have used in my controlDict file. Code:
acceleration Also I have added the probe locations as per below. Code:
probes |
All times are GMT -4. The time now is 19:08. |