Vector Center Face ---> Cells
Hello to all,
i'm going to modify the equations at the boundary to run an adjoint simulation. One of these equations includes a term r which is defined as the position vector starting from the center of the outlet surface. I know the face center can be accessed by the function Cf() but i don't know how to set it for the entire outlet boundary and for the single cell. Could someone help me defyning it? Thanks for help, Roberto |
Sorry for Bump,
i have not resolved the problem yet here my equation: Code:
u_tw = 1/(v_n - nu/h)*(-nu/h*u_(tw-1) + 2*(n x r)/|| r x v_t ||^(3) ) Code:
void Foam::adjointOutletVelocityFvPatchVectorField::updateCoeffs() I have only to define r |
Hi again,
Can i use something like this? Is it right for my scope? Code:
vectorField r = patch().Cf()-(10 15 30); Code:
patch().Cf() Regards, Roberto |
Hi,
To get the center of the patch try using a bounding box, then average the limits. it would be your center. For the code you have up there, change it to this: Quote:
|
Hi Mahdi, thanks for your reply.
Your solution is almost perfect but it's necessary to insert a comma between the elements vectors. Code:
vectorField r = patch().Cf()-vector(10,15,30); Best Regards, Roberto |
All times are GMT -4. The time now is 15:08. |