# Is there a function for calculating divergence of a value? Or perhaps of a UDS?

• 38 Views
• Last Post 31 January 2019
• Topic Is Solved
tallred11 posted this 30 January 2019

Hello,

I'm attempting to calculate the divergence of the normal vector with respect to the interface in my VOF simulation in order to obtain the curvature. Is there a way to do this? I know I can obtain a gradient by adding the "_G" to the end of certain functions. Is there anything similar for divergence?

Thanks!

abenhadj posted this 31 January 2019

No. You can use dot product to build it up. Check vector operations in customization manual.

Best regards,

Amine

• Liked by
tallred11 posted this 31 January 2019

Thanks, Amine.

I see that I can do a dot product, but I can't really create a del operator to dot with the normal vector can I?

abenhadj posted this 31 January 2019

You can use dot product to create the divergence you are looking for or better explain what you wan to have!

Best regards,

Amine

tallred11 posted this 31 January 2019

In order to obtain the divergence, I need to dot the del operator {d/dx, d/dy, d/dz} with the normal vector, say {a,b,c}.

I see I can use ND_DOT to do a dot product, but is there really a way to make a del operator?

Or do I have to manually do da/dx + db/dy + dc/dz? I can do the numerical differentiation myself in a UDF, but thought there would be a more accurate way to do it.

tallred11 posted this 31 January 2019

I think that I thought of a way to do it. I guess I can just take the gradient and dot it with the vector {1,1,1}. Thanks!

abenhadj posted this 31 January 2019

Build the gradient and just sum the components.

Best regards,

Amine