CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   initialize pressure gradient (http://www.cfd-online.com/Forums/openfoam/90091-initialize-pressure-gradient.html)

jiejie June 30, 2011 07:55

initialize pressure gradient
 
Dear Foamers

I am try to setup a Gaussian vortex case, which has a given velocity field and pressure gradient field. I am able to write a app to initialize the velocity across the flow domain by looping through each individual cells. However, I am having problem to initialize the pressure gradient as it requires more than one cell. Would anyone have some suggestions on how to implement this?

Thank you.

nimasam June 30, 2011 09:25

my suggestion :
1) add to createFields.H
volVectorField dpdx
(
IOobject
(
"dpdx",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

2) add file dpdx with dimension of (p/length) in folder 0

3) use funkySetFields from openFoam wiki to initialize the field

jiejie June 30, 2011 09:36

Hi nimasam

It requires more cell points to calculate the pressure gradient but not sure how to convert pressure gradient to pressure?

I came across the funkyFields but never used it before. Would you be able to elaborate a bit more on it?

Thanks for the reply.

nimasam June 30, 2011 09:46

i can't understand, whats ur mean ? ;)

jiejie June 30, 2011 09:49

Quote:

Originally Posted by nimasam (Post 314238)
i can't understand, whats ur mean ? ;)

Sorry for the confusion. What I mean is you need more than one cell to calculate the pressure gradient. Is it possible to calculate the pressure at each cell if I know the pressure gradient? This is because I need to initialize the pressure field but I only have the information of the pressure gradient.

nimasam June 30, 2011 09:59

im not sure! it would be compilicated but maybe you can look at streamFunction and use similar method!


All times are GMT -4. The time now is 03:09.