CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   InterFoam- rotating wall. Initializing swirl in setFields (https://www.cfd-online.com/Forums/openfoam-solving/103865-interfoam-rotating-wall-initializing-swirl-setfields.html)

Krishna Sandeep June 28, 2012 02:05

InterFoam- rotating wall. Initializing swirl in setFields
 
Hi everyone,
I am using interFoam to capture the interface between air and water in a rotating tank. I need to patch the initial swirl to the water field so that it doesn't take much time for the momentum to be transferred to water from the rotating tank wall. Can I initialize it using setFields directory? Please help me with this.

Regards
Sandeep.

vonboett June 28, 2012 08:17

Do you know the shape and velocity of the initial swirl?

If yes, you can do some bad workaround by using a dummy setFieldsDict that defines after the defaultFieldValues (...); for example regions ( boxToCell{ box (coordinates of lower-back box edge) (coordinates of upper-front box edge); fieldValues( volScalarFieldValue alpha1 1 volVectorFieldValue U (0 0 1); } );
If you call setFields your initial U and alpha1 fields will be filled with as many entries as you have cells in your grid. Now you can overwrite each of these lines with the correct field value, but this needs soem exel sheet work first to account for the fact that you have to know for each line which cell / which position it is related to. But be aware not to conflict with boundary settings, otherwhise these have to be adjusted the same way.

Much better would be to run the case with a much coarser grid so that you get a rough swirl, and then using mapFields to project your values from the coarse grid case to the fine grid case. Yust keep in mind that for mapping the time folders of the coarse case folder and the fine case folder have to be the same and have to correspond to the startTime in controlDict, so if you ran your coarse simulation until t=10s and you want to map your solution of the folder 10 to the fine case, rename your 0 folder in the fine case to 10, change the startTime in your controlDict to 10, call mapFields, and then rename your fine folder 10 to your starting folder 0. Somehow irritating to explain but you ll see what I mean if you try it out.

Krishna Sandeep June 28, 2012 11:29

Quote:

Originally Posted by vonboett (Post 368726)
Do you know the shape and velocity of the initial swirl?

If yes, you can do some bad workaround by using a dummy setFieldsDict that defines after the defaultFieldValues (...); for example regions ( boxToCell{ box (coordinates of lower-back box edge) (coordinates of upper-front box edge); fieldValues( volScalarFieldValue alpha1 1 volVectorFieldValue U (0 0 1); } );
If you call setFields your initial U and alpha1 fields will be filled with as many entries as you have cells in your grid. Now you can overwrite each of these lines with the correct field value, but this needs soem exel sheet work first to account for the fact that you have to know for each line which cell / which position it is related to. But be aware not to conflict with boundary settings, otherwhise these have to be adjusted the same way.

Much better would be to run the case with a much coarser grid so that you get a rough swirl, and then using mapFields to project your values from the coarse grid case to the fine grid case. Yust keep in mind that for mapping the time folders of the coarse case folder and the fine case folder have to be the same and have to correspond to the startTime in controlDict, so if you ran your coarse simulation until t=10s and you want to map your solution of the folder 10 to the fine case, rename your 0 folder in the fine case to 10, change the startTime in your controlDict to 10, call mapFields, and then rename your fine folder 10 to your starting folder 0. Somehow irritating to explain but you ll see what I mean if you try it out.

Oh thank u. I shall try what u were saying. But dont we have a simple syntax for initializing the swirl as we have for a rotatingWallVelocity?

Bernhard June 29, 2012 03:07

Probably you want to use funkySetFields instead of setFields. With funkySetFields you can set the value of velocity as a function of some parameters, probably you want to have something like "U0*vector(pos().y,-pos().x,1)"


All times are GMT -4. The time now is 23:50.