View Issue Details

IDProjectCategoryView StatusLast Update
0002586OpenFOAMBugpublic2017-06-20 14:27
Reportervok Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionduplicate 
Summary0002586: Direction vector of ray in radiation model
DescriptionHi,

When solving the radiative transport equation (RTE) using the finite-volume method (fvDOM), perhaps I found a bug in the file RadiativeIntensityRay.C. Hopefully it is my wrong, I appreciate it if you can point out my error.

In defining the vector of ray, the code is

d_ = vector(sinTheta*sinPhi, sinTheta*cosPhi, cosTheta); // three components of direction, i, j, and k.

However, I think the correct order should be

d_ = vector(sinTheta*cosPhi, sinTheta*sinPhi, cosTheta); //
x = r*sin(θ)*cos(ψ), y=r*sin(θ)*sin(ψ), z=r*cos(θ)

In the same manner, the first and second terms in the vector dAve_ are also reversed.

The key is the product between vectors of dAve_ and mesh_sf(), or, Ji

const surfaceScalarField Ji(dAve_ & mesh_.Sf());

If the i and j terms in the dAve vector are reversed, the magnitude of Ji is completely different.

In addition, I re-calculated the dAve vector which seems to be different from yours,

dAve_ = vector
    (
        cosPhi
       *Foam::sin(0.5*deltaPhi)
       *(deltaTheta - (Foam::cos(2.0*theta)
       *Foam::sin(deltaTheta))),
        sinPhi
       *Foam::sin(0.5*deltaPhi)
       *(deltaTheta - (Foam::cos(2.0*theta)
       *Foam::sin(deltaTheta))),
        0.5*deltaPhi*Foam::sin(2.0*theta)*Foam::sin(deltaTheta)
    );

Thank you.
TagsNo tags attached.

Relationships

duplicate of 0002538 closedhenry possible wrong coordinates for d and dAve vector in radiativeIntensityRaySolid.C from fvDOM radiation model 

Activities

henry

2017-06-20 13:39

manager   ~0008231

See https://bugs.openfoam.org/view.php?id=2538

vok

2017-06-20 14:20

reporter   ~0008232

OK, the azimuthal angle is from y to x :)

Issue History

Date Modified Username Field Change
2017-06-20 13:31 vok New Issue
2017-06-20 13:39 henry Note Added: 0008231
2017-06-20 13:40 henry Relationship added duplicate of 0002538
2017-06-20 14:20 vok Note Added: 0008232
2017-06-20 14:27 henry Assigned To => henry
2017-06-20 14:27 henry Status new => closed
2017-06-20 14:27 henry Resolution open => duplicate