CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   User defined field function. (https://www.cfd-online.com/Forums/star-ccm/128872-user-defined-field-function.html)

karthik1413 January 23, 2014 04:53

User defined field function.
 
Hello all i want to write a user defined field function for the streamwise pressure gradient.(I am trying to refine mesh based on the field functions).I have extracted the apparent pressure gradient by using the temporary storage retained feature.Can someone please help me to define the "streamwise pressure gradient" using the apparent pressure gradient.Thanks

Regards
Karthik

flotus1 January 23, 2014 05:58

Isnt that simply projecting the pressure gradient vector onto the velocity vector?

http://en.wikipedia.org/wiki/Vector_projection

karthik1413 January 23, 2014 07:03

Yes!!!!!!!!!! Thank you got it!!

karthik1413 January 23, 2014 10:31

(/(+(+(* $${Velocity}[0] $${ApparentPressureGradient}[0]) (* $${Velocity}[1] $${ApparentPressureGradient}[1])) (* $${Velocity}[2] $${ApparentPressureGradient}[2])) ${Velocity_0})

this is what i got..


All times are GMT -4. The time now is 15:56.