Need to define a particular field
Hi to everyone!
I need to define a new scalar field but just over a patch that represents an airfoil and later I want to be able to see it in paraFoam. Which is a possible solution to do that? I've been looking for something similar but I can't find anything. Cheers, Simone |
Hey Simione,
define yourself a new volScalarField Code:
volScalarField myField Get to your airfoil patch Code:
word patchName = "airfoil"; //or whatever Code:
const fvBoundaryMesh& bdy = mesh.boundary(); Code:
myField.boundaryField()[patchID] = /*put your computation here*/; Hope this helps... |
kathrin_kissling,
thank you really much for your answer. I'll try your advice soon and let you know if it works! By the way I've got also another trouble now: I know that there is fvc::interpolate function to get the value of a volumeField on to a surfaceField. But my question is: is there a function that can interpolate the value of a surfaceField on to a volumeField?? I really need it right now. Thanks for your help Simone |
It doesn't work :(. Here's the error:
Quote:
Quote:
|
Now everything is ok! I had put the wrong name for the patch :). Now it remains the problem about interpolation..:)
Any suggestion is really appreciated!! |
fvc::average will do the trick!
directly from fvcAverage.H: Area-weighted average a surfaceField creating a volField Best Kathrin |
Thanks again!!
If I want to evaluate some variable only on the patch just defined, let's say U, I only have to do something like: mypatch.boundaryField()[patchID]= U.boundaryField()[patchID]... right? |
And, by the way, how would you impose a set of "nonuniform" but fixedValue BC over a patch?
What I need is, substantially, to impose different normal velocities over an airfoil. Cheers Simone |
All times are GMT -4. The time now is 17:35. |