View Issue Details

IDProjectCategoryView StatusLast Update
0002965OpenFOAMContributionpublic2018-06-01 09:56
Reporterniklas Assigned Towill  
PrioritynormalSeveritytrivialReproducibilityhave not tried
Status resolvedResolutionfixed 
Fixed in Versiondev 
Summary0002965: suggestion for code improvement for bugfix 2956
DescriptionCould edit the bug report so Im submitting a fix here instead.
Instead of using a random number to calculate the tangential vectors in ConeNozzleInjection,
this might be a better method


    // Determine direction vectors tangential to direction
    tanVec1_ = vector(-direction_.y(), direction_.x(), 0.0);
    if (mag(tanVec1_) < SMALL)
    {
        tanVec1_ = vector(-direction_.z(), 0.0, direction_.x());
    }

    tanVec1_ /= mag(tanVec1_);
    tanVec2_ = direction_^tanVec1_;
TagsNo tags attached.

Activities

will

2018-06-01 09:10

manager   ~0009681

This has already been done, I just put the functionality quite low down so that other stuff can use it. Look at commit b989b81d. It defines a "perpendicular" method in VectorI.H which does something similar to what you are suggesting. The only difference is it switches between all three options (-z, 0, x), (0, z, -y) and (y, -x, 0), depending on which is most stable.

niklas

2018-06-01 09:52

reporter   ~0009682

Excellent :)

Issue History

Date Modified Username Field Change
2018-06-01 09:01 niklas New Issue
2018-06-01 09:10 will Note Added: 0009681
2018-06-01 09:52 niklas Note Added: 0009682
2018-06-01 09:56 will Assigned To => will
2018-06-01 09:56 will Status new => resolved
2018-06-01 09:56 will Resolution open => fixed
2018-06-01 09:56 will Fixed in Version => dev