How to implement a *.C file including a numerical integral function #17258
-
Hi everyone, I will solve the following equation at each time step to update "a1" for the other calculation. I got stock to how to figure out the integral. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Dear @sSajjad90 The ElementIntegralVariableUserObject integrates a variable over the volume. You could write your own custom material that calculates the integral using the coupled variable a_1 I think the most difficult part is calculating the integral, c++ probably does not have a function for that. Also, you can check if wolfram alpha gives you an analytical expression for your integral. Best Regards, |
Beta Was this translation helpful? Give feedback.
Dear @sSajjad90
The ElementIntegralVariableUserObject integrates a variable over the volume.
I think what you want to do is to integrate over the variable \rho; it is a one dimensional integral.
You could write your own custom material that calculates the integral using the coupled variable a_1
Then you store the integral in a material property
and you use the material property to implement a kernel for the second term in your last equation.
I think the most difficult part is calculating the integral, c++ probably does not have a function for that.
Otherwise, you will need to write your own .C code to integrate your function using an iterative method to check for convergence
because your …