CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] funkySetFiekds - linear velocity distribution (https://www.cfd-online.com/Forums/openfoam-community-contributions/129226-funkysetfiekds-linear-velocity-distribution.html)

hxaxtma January 31, 2014 04:14

funkySetFiekds - linear velocity distribution
 
Hi,

I need to set for my case the internal field to a linear Velocity distribution from 0 to 1. How can I apply this with funkySetFields? I am not sure how to formulate the expression itself


Thanks for all

gschaider January 31, 2014 05:26

Quote:

Originally Posted by hxaxtma (Post 472737)
Hi,

I need to set for my case the internal field to a linear Velocity distribution from 0 to 1. How can I apply this with funkySetFields? I am not sure how to formulate the expression itself


Thanks for all

"linear distribution" in what sense (in space?). Write down the equation and you're halfway there (but your question is a bit to vague to properly help you)

hxaxtma January 31, 2014 07:29

sorry for lack of information:

I think I am almost there, the vel. distribution should be in space


this is my code:
Code:

funykSetFields -case . -field U - expression 'pos().z/max(pos().z)*vector(1,0,0)' -time 0 -keepPatches

No I get my linear profile.


Is there a more elegant way to set up the expression?

gschaider January 31, 2014 18:51

Quote:

Originally Posted by hxaxtma (Post 472790)
sorry for lack of information:

I think I am almost there, the vel. distribution should be in space


this is my code:
Code:

funykSetFields -case . -field U - expression 'pos().z/max(pos().z)*vector(1,0,0)' -time 0 -keepPatches

No I get my linear profile.


Is there a more elegant way to set up the expression?

Not more elegant, but more accurate : I'd suggest "interpolateToCell(max(pts().x))" if you want the profile to 'end' at the boundary of the geometry not at the center of the uppermost cell

hxaxtma February 2, 2014 10:35

Thanks Gschaider,

Thread is closed:)


All times are GMT -4. The time now is 14:46.