libAcoustics icon indicating copy to clipboard operation
libAcoustics copied to clipboard

Calculating Distance

Open Z-K-L opened this issue 2 years ago • 7 comments
trafficstars

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).

Z-K-L avatar Oct 13 '23 05:10 Z-K-L

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

mkraposhin avatar Oct 23 '23 09:10 mkraposhin

at fwhFormulation.C line 236~237

Z-K-L avatar Dec 01 '23 06:12 Z-K-L

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

mkraposhin avatar Dec 05 '23 07:12 mkraposhin

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])) );

unicfdlab avatar Dec 06 '23 09:12 unicfdlab

Thank you!

Z-K-L avatar Dec 18 '23 06:12 Z-K-L

@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 avatar Dec 18 '23 07:12 mkraposhin

@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.

mkraposhin avatar Dec 18 '23 11:12 mkraposhin