CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   laplacian for local "elements" (http://www.cfd-online.com/Forums/openfoam-programming-development/113151-laplacian-local-elements.html)

Fabian_W February 13, 2013 13:13

laplacian for local "elements"
 
I have a non-regular grid.

I need to have a matrix at hand for the Laplacian operator.

I do
fvMatrix<scalar> m = fvm::laplacian(k, h);
where h seems (and shall be) irrelevant.

Now to my issue. I need to work on a subset of the nodes. Say 10 nodes are of interest.
I can set all nodes but the few special one in k to zero and get m which is zero in most coefficients.

The question is, is there a way to construct a smaller m?

One idea is, to create a smaller vector k which has only the nodes from the set and all neighbors of these nodes. Is this a good idea? How can I construct such a volScalarField?

I'm quite new to OpenFOAM, help is very much appreciated!

Fabian

ziemowitzima February 14, 2013 12:56

Hi,

I am not sure if this is of any help, but...
In OF you can have "k = k(x,y,z)" (diffusion coeff) which is function of space. So maybe solution to your problem is to define "k" in a way that it has some value in desired nodes, and zero in other. But then there are two different types of equations in one domain.

Other way would be two define two meshes (or sub-mesh) on which different equations could be solved.

best
ZZM

Fabian_W February 15, 2013 09:33

Thanks for your reply.

Setting almost everything in k indeed does the job but it is too slow as I need to do it a million times for different selected nodes.

I currently try to implement the stencil by myself. Any hint? link?

Thanks,

Fabian


All times are GMT -4. The time now is 21:40.