View Issue Details

IDProjectCategoryView StatusLast Update
0003891OpenFOAMPatchpublic2022-09-21 13:55
Reportertniemi Assigned Tohenry  
PrioritylowSeveritytrivialReproducibilityN/A
Status resolvedResolutionfixed 
Product Versiondev 
Fixed in Versiondev 
Summary0003891: Patch: better error messages for actuationDiskSource
DescriptionI have attached a small patch which fixes error messages in actuationDiskSource. At present the errors are quite confusing due to using a wrong error macro.

Current error message:
--> FOAM FATAL IO ERROR:


file: unknown

FOAM exiting


Error after:
--> FOAM FATAL IO ERROR:
disk direction vector is approximately zero

file: /turbineSiting/constant/fvModels/disk1 from line 19 to line 27.

    From function void Foam::fv::actuationDiskSource::readCoeffs()
    in file derived/actuationDiskSource/actuationDiskSource.C at line 65.

FOAM exiting
TagsNo tags attached.

Activities

tniemi

2022-09-21 12:17

reporter  

patch.diff (1,684 bytes)   
diff --git a/src/fvModels/derived/actuationDiskSource/actuationDiskSource.C b/src/fvModels/derived/actuationDiskSource/actuationDiskSource.C
index d64fda507..0c100aac7 100644
--- a/src/fvModels/derived/actuationDiskSource/actuationDiskSource.C
+++ b/src/fvModels/derived/actuationDiskSource/actuationDiskSource.C
@@ -62,7 +62,7 @@ void Foam::fv::actuationDiskSource::readCoeffs()
     diskDir_ = coeffs().lookup<vector>("diskDir");
     if (mag(diskDir_) < vSmall)
     {
-        FatalErrorInFunction
+        FatalIOErrorInFunction(coeffs())
            << "disk direction vector is approximately zero"
            << exit(FatalIOError);
     }
@@ -71,7 +71,7 @@ void Foam::fv::actuationDiskSource::readCoeffs()
     Ct_ = coeffs().lookup<scalar>("Ct");
     if (Cp_ <= vSmall || Ct_ <= vSmall)
     {
-        FatalErrorInFunction
+        FatalIOErrorInFunction(coeffs())
            << "Cp and Ct must be greater than zero"
            << exit(FatalIOError);
     }
@@ -79,7 +79,7 @@ void Foam::fv::actuationDiskSource::readCoeffs()
     diskArea_ = coeffs().lookup<scalar>("diskArea");
     if (magSqr(diskArea_) <= vSmall)
     {
-        FatalErrorInFunction
+        FatalIOErrorInFunction(coeffs())
            << "diskArea is approximately zero"
            << exit(FatalIOError);
     }
@@ -88,7 +88,7 @@ void Foam::fv::actuationDiskSource::readCoeffs()
     upstreamCellId_ = mesh().findCell(upstreamPoint_);
     if (returnReduce(upstreamCellId_, maxOp<label>()) == -1)
     {
-        FatalErrorInFunction
+        FatalIOErrorInFunction(coeffs())
            << "upstream location " << upstreamPoint_  << " not found in mesh"
            << exit(FatalIOError);
     }
patch.diff (1,684 bytes)   

henry

2022-09-21 13:55

manager   ~0012748

Resolved by commit c90671c8b7596e81c3090834b427221abae0a014

Issue History

Date Modified Username Field Change
2022-09-21 12:17 tniemi New Issue
2022-09-21 12:17 tniemi File Added: patch.diff
2022-09-21 13:55 henry Assigned To => henry
2022-09-21 13:55 henry Status new => resolved
2022-09-21 13:55 henry Resolution open => fixed
2022-09-21 13:55 henry Fixed in Version => dev
2022-09-21 13:55 henry Note Added: 0012748