CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   use mesh.points().x() as boundary values (https://www.cfd-online.com/Forums/openfoam/88323-use-mesh-points-x-boundary-values.html)

oskarb May 13, 2011 15:09

use mesh.points().x() as boundary values
 
Hello,
can some1 plz answer how to use one of the mesh point coordinate components as boundary patchField? I have to solve a volScalarField that equals the x coordinate everywhere on the boundary.
After searching the Wiki I think groovyBC could be used for this purpose, but do the "official" fvPatchFields allow such a function?

Additionally I would like to ask how to define a volVectorField that equals the surface normal vector everywhere on the boundary?

thx
Oskar

oskarb May 16, 2011 04:26

Hello again,
is there no solution to use mesh coordinates as boundary conditions without installing groovyBC?

Is it possible to write interpolated mesh.points().x() as a surfaceScalarField to disk and then map this field onto the boundary patch (directMappedFixedValue?)? Does an example exist how to use nonuniform values as boundary condition?

thanks
Oskar

Bernhard May 16, 2011 04:50

Of course the are a lot of possibilities to do this, but what is the problem with groovyBC? You give expressions for the value or gradient at a patch. If this is what you want, than I would go for groovyBC.

oskarb May 16, 2011 05:34

Bernhard,
there is no problem with groovyBC in general. It is simply not included in my primary openfoam installation, and i cannot compile binaries on that system.

Please describe one of the lots of possibilities how to use the values from a surfaceScalarField on disk as boundary condition.

thx
Oskar

Bernhard May 16, 2011 05:44

If you are not allowed to compile anything, than the fun part of OpenFOAM is not available, and there are not a lot of options left. You can provide a list of values as a boundary condition, but this is quite cumbersome, especially if you want to change anything later on in your case.

oskarb May 16, 2011 06:22

Providing a list of values as boundary condition means that I replace a boundaryField declaration like

Code:

top{
  type fixedValue;
  value uniform 0;
}

with

Code:

top{
  type fixedValue;
  value (x0 x1 x2 ... xn);
}

or what is the correct syntax for such a value list?
If it works like this, I can define the patches in the Allrun script, and my question would be answered.

thanks
Oskar

Bernhard May 16, 2011 06:52

It looks something like that, with value nonuniform List<scalar> .... I suppose you can easily find an example somewhere. (See: /tutorials/incompressible/simpleFoam/pitzDailyExptInlet )

Linse August 26, 2011 12:03

Although not concerning the setting of the specific values:
Are you sure you cannot use groovyBC (or swak4foam, which includes groovyBC by now)?
Just give it a try to install! It might be highly useful sometime else for playing with OF...

In my case it installed nicely into my own, accessible folder, while I do not have write-access to any of the system-wide installation directories. Just see if you have access to $FOAM_USER_APPBIN and $FOAM_USER_LIBBIN - which actually should point to directories within your own directories on the system.


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