CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Accessing velocity components and gradient of velcoity components (https://www.cfd-online.com/Forums/openfoam-programming-development/131216-accessing-velocity-components-gradient-velcoity-components.html)

vivekgnhtr March 11, 2014 11:22

Accessing velocity components and gradient of velcoity components
 
Dear All,

I am trying to implement a SGS model in openFOAM for incompressible flows. For that i am using existing constant Smagorinsky model implementation.

For my SGS model, I need to access cell velocity components and gradU components.

Can anybody help me out how can i access these components.


Thanks and Regards,
vivek

watermelon June 25, 2022 03:27

Quote:

Originally Posted by vivekgnhtr (Post 479381)
Dear All,

I am trying to implement a SGS model in openFOAM for incompressible flows. For that i am using existing constant Smagorinsky model implementation.

For my SGS model, I need to access cell velocity components and gradU components.

Can anybody help me out how can i access these components.


Thanks and Regards,
vivek

Hello vivek, do you already solve this problem?

I also meet this problem, thank you!

überschwupper June 27, 2022 02:24

U_.component(direction)


I also think calling .x(), .y(), .z() should work.



This should work for both since grad() also returns a vectorField.

watermelon June 27, 2022 02:39

Quote:

Originally Posted by überschwupper (Post 830524)
U_.component(direction)


I also think calling .x(), .y(), .z() should work.



This should work for both since grad() also returns a vectorField.

Thank you sir, I already use the U_.component(0), U_.component(1), to get the Ux, Uy, and so on.

Thanks for your reply!:D


All times are GMT -4. The time now is 06:31.