Copy boundaryField into adjacent cell
Hello everyone,
I have a volScalarField E, and I need to copy the boundary field (i.e., the value defined as bc in the 0 folder) into the cells adjacent to the boundary. In other words, for every patch and for every face of the patch: internalField of E = boundary field of E, for that patch and that face. I tried different solutions, but I deleted them since none of them worked. Someone can help me? Thank you and best regards. |
One easy solution may be:
Let the simulation run for a sohrt time. In the result folder you find a result for your fields. This replaces the original "internal field uniform .." line. Analyze this field to find out which values belongs to which part of the geometry. If you use blockMesh und your geometry is not very complicated, this is not an hard task. Write a little program in any programming language which sets the initial field the way you need it. |
Thanks Uwe,
but the mesh is complex and I need some loop who does it automatically. I was trying this one, but it doesn't work: Code:
forAll (mesh.boundaryMesh(), patchI) The boundaryFields containes eiher zeros or positive numbers (they are ficedValue BC's). Any idea? Thanks. |
You are probably looking for the method patchInternalField(). Here is an example (actually doing the opposite of what you want to do: Set the boundary values based on the internal values): https://github.com/OpenFOAM/OpenFOAM...FvPatchField.C
|
Quote:
I think this should do the job for you Code:
forAll(mesh.boundary(), patchI) |
All times are GMT -4. The time now is 13:41. |