View Issue Details

IDProjectCategoryView StatusLast Update
0002538OpenFOAMFeaturepublic2017-06-20 13:40
Reporterheyheymymy Assigned Tohenry  
PrioritynormalSeveritycrashReproducibilityN/A
Status closedResolutionno change required 
Summary0002538: possible wrong coordinates for d and dAve vector in radiativeIntensityRaySolid.C from fvDOM radiation model
DescriptionIn radiativeIntensityRaySolid.C, line 126, the ray direction vector is defined as follows:

d_ = vector(sinTheta*sinPhi, sinTheta*cosPhi, cosTheta);

In my opinion, in the spherical coordinate system, the coordinates should be:

d_ = vector(sinTheta*cosPhi, sinTheta*sinPhi, cosTheta);

This also impacts dAve vector calculation.

TagsNo tags attached.

Relationships

has duplicate 0002586 closedhenry Direction vector of ray in radiation model 

Activities

heyheymymy

2017-05-04 16:02

reporter   ~0008089

Sorry I meant RadiativeIntensityRay.C

henry

2017-05-04 16:16

manager   ~0008090

Can you provide an example case which demonstrates the need for the change you propose?

heyheymymy

2017-05-05 09:29

reporter   ~0008097

I tried to think of a case example that could demonstrates the need for the change but I unfortunately could not find one.

Indeed, as the solver is used with diffusive boundary conditions, the intensity of the incoming rays in each direction at the walls are summed to evaluate the reflection intensity.
Doing so, the possible problem of the ray orientation is probably evened out and thus less critical as I initially thought.

However, if the definition of the vector is wrong, I think it should be corrected for clarity.

Also this could have effect if one is interested in the implementation of specular reflective boundary condition.

henry

2017-05-05 09:57

manager   ~0008098

> However, if the definition of the vector is wrong, I think it should be corrected for clarity.

If the definition of the vector is wrong it should be possible to provide a case which demonstrates this? If I make any changes to the code how should they be validated?

henry

2017-05-05 18:40

manager   ~0008104

I have studies the code and cannot see a reason why the coordinate transformation is defined in this way and

vector(sinTheta*cosPhi, sinTheta*sinPhi, cosTheta)

would be more consistent and logical.

Have you validated this change?

tniemi

2017-05-08 13:06

reporter   ~0008117

I believe the current implementation is otherwise ok, the angle phi is just defined in such a way that it is the angle from y-axis in clockwise direction, ie. it is the azimuthal angle. This is also stated in the fvDOM.h header usage example.

I don't know the motivation behind this convention, but I have seen it being used by some scientific authors and also in some other CFD code. However, I cannot say which convention is more popular as also the regular spherical coordinates are used.

henry

2017-05-08 13:17

manager   ~0008118

@tniemi: thanks for your valuable input. I think that it is best to leave the code as it is given that it is correct, internally consistent, consistently documented and validated.

Issue History

Date Modified Username Field Change
2017-05-04 15:40 heyheymymy New Issue
2017-05-04 16:02 heyheymymy Note Added: 0008089
2017-05-04 16:16 henry Note Added: 0008090
2017-05-05 09:29 heyheymymy Note Added: 0008097
2017-05-05 09:57 henry Note Added: 0008098
2017-05-05 18:40 henry Note Added: 0008104
2017-05-08 13:06 tniemi Note Added: 0008117
2017-05-08 13:17 henry Note Added: 0008118
2017-05-08 13:17 henry Assigned To => henry
2017-05-08 13:17 henry Status new => closed
2017-05-08 13:17 henry Resolution open => no change required
2017-06-20 13:40 henry Relationship added has duplicate 0002586