Setting time varying flow field in OpenFOAM
Hello everyone,
I'm a newbie in OpenFoam. There is a problem which I have already searched from the internet for many days and still have not been solved. The problem is : whether OpenFOAM is able to achieve the velocity like the following U=sin(2*pi*y)*sin(pi*x)*cos(pi*t/T) pi = 3.14 T is the period t is the current time Thanks Tings |
Hi,
Guess, you need this velocity at the inlet boundary and x, y denote centres of faces. Use codedFixedValue BC. You can find an example in $FOAM_SRC/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.H. Access to time is shown in example, you can access to face centres using patch().Cf() vector field. |
Hi to all,
i'm also interested on this topic. I trying to impose an internal (non bc!!), non-uniform, time varying, velocity field. specifically the field will should be Ux = 2sin^2(pi*x)*sin(2*pi*y)*sin(2*pi*z)*cos(2*pi*t/T) Uy = -sin(2*pi*x)*sin^2(pi*y)*sin(2*pi*z)*cos(2*pi*t/T) Uz = -sin(2*pi*x)*sin(2*pi*y)*sin^2(pi*z)*cos(2*pi*t/T) Any idea? Thanks Francesco |
Hi,
@phemt84 It depends. If it is your own solver: just set velocity, cycle through cells, get centres, calculate velocity. If you need this velocity in standard solver, you can use codedFunctionObject (you add code to codeExecute section, so you set velocity on every runTime++). |
Quote:
first of all thanks for your answer. I will should use it with interFoam solver, specifically the result that i would like to obtain is this: https://www.youtube.com/watch?v=tW0S6V6tg9E I'm quite new in openFoam programming. Could you better explain the use of codedFunctionObject?? Thanks |
interFoam solves NS for get velocity. You want to impose internal field. It looks a little bit bizarre. If you need something calculated with isoAdvector, why don't you got to isoAdvector repository and just download case files?
Quote:
|
All times are GMT -4. The time now is 15:05. |