CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Scaling boundary conditions (http://www.cfd-online.com/Forums/openfoam-pre-processing/116094-scaling-boundary-conditions.html)

Nucleophobe April 12, 2013 14:53

Scaling boundary conditions
 
I have a case with non-circular inlets on which I needed to specify fully developed flow. To do so, I extruded the inlets beyond the entry length, and ran a case for each inlet to convergence. I then used the mapFields utility to map the solved velocity for the inlets onto the real case.

I would now like to scale the fully developed flow, say from 1 liter per minute to 2 liters per minute. Is there an easy way to scale my boundary conditions? My 0/U file looks like this right now:
Code:

    inlet1
    {
        type            fixedValue;
        value          nonuniform List<vector>
**binary values**
  inlet 2
  {...

I know I could code something to do this, but I'm not sure how to start with the 'U' file in half-ascii and half-binary.

Thanks,
-Nuc

Nucleophobe April 15, 2013 09:25

Well, I ended up doing the following:
1) Run the simulation one time step with the controlDict switched to ascii mode
2) Use find-replace in 'vim' to reduce the boundary conditions to a three-column data file
3) Use 'awk' to multiply the data in each column by a constant
4) Use 'vim' to recompose the boundary conditions as desired

It's a slow solution but it worked for me. Any further ideas for the future are appreciated.

Thanks all.


All times are GMT -4. The time now is 08:27.