unicfdlab / libAcoustics

libAcoustics - OpenFOAM library for far-field noise computation
140 stars 57 forks source link

Calculating Distance #106

Open Z-K-L opened 1 year ago

Z-K-L commented 1 year ago

Why magrobs[iObs][iSurf][i] = mag(robs[iObs][iSurf][i]) is not used, instead caculated the |r| = (-U_0*x/c_0+R)/(1-(U_0/c_0)^2).

mkraposhin commented 1 year ago

Hi, could you please point to the line of source code that confuses you?

Z-K-L commented 11 months ago

at fwhFormulation.C line 236~237

mkraposhin commented 10 months ago

Thank you for the question, I think we should ask latest contributors. @eacfd @unicfdlab could you please comment this question?

unicfdlab commented 10 months ago

The distance is calculated using the GT formulation. If you use Farassat Formulation (U0 is equal 0) the distance will be equal to mag(robs[iObs][iSurf][I]). ` magrobs[iObs][iSurf][i] = (-(mag(fwh.U0)/fwh.c0) r[0] + R)/(1 - sqr(mag(fwh.U0)/fwh.c0)); if U0=0 then magrobs[iObs][iSurf][i] = (0 +R)/(1-0)` where R `scalar R = sqrt( sqr(r[0])+( 1 - sqr(mag(fwh.U0)/fwh.c0_))(sqr(r[1]) + sqr(r[2])) ); for U0 = 0 R_ = sqrt( sqr(r[0])+(sqr(r[1]) + sqr(r[2])) );`

Z-K-L commented 10 months ago

Thank you!

mkraposhin commented 10 months ago

@unicfdlab , I'm sorry, but I cannot agree with your explanation. magrobs array is calculated in fwhFormulation.C, which is common both for GT formulation and Farassat Formulation. Therefore, should we move calculation of magrobs (and dependent variables) into different modules ?

mkraposhin commented 10 months ago

@unicfdlab , I'm sorry, but I cannot agree with your explanation. magrobs array is calculated in fwhFormulation.C, which is common both for GT formulation and Farassat Formulation. Therefore, should we move calculation of magrobs (and dependent variables) into different modules ?

This question has been resolved. R is a weighted verison of magrobs . Sorry for possible panic.