Skip to content

Commit

Permalink
revisit of issue #458, foam 8 vs 2.2.0 stuff
Browse files Browse the repository at this point in the history
small cleanup fix to openfoam 2.2.0 case directory nut file, makes paraview complain a ton less, also makes it more compatible going back and forth between versions of OpenFOAM with the same case generated by both versions of OpenFOAM. Also small cleanup to the openfoam 2.2.0 inlet BC applications to actually print out the uDirection when running anything foam as that also helps with compatibility going back between versions of OpenFOAM, also why print it within WindNinja if the OpenFOAM BC is gonna drop it whenever it is called, made sense to make it consistent.

was going to do an additional commit to maybe cleanup the BC function names, to also make the cases more compatible back and forth, but I was pleased to find that the current methodology already has the compatible and same BC function names that I was thinking of.

with these small changes, I was able to run both versions of OpenFOAM on the same case, and open both cases with both versions of OpenFOAM/paraview. Well had to drop the functions part of the controlDict for the foam 8 case, but that was just commenting stuff out, not adding stuff back in.

for issue #458
  • Loading branch information
latwood committed Mar 19, 2024
1 parent 4d6f2d1 commit d2b8014
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion data/ninjafoam/2.2.0/0/nut
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ boundaryField
minZ
{
type nutkAtmRoughWallFunction;
z0 $z0$;
z0 uniform $z0$;
value uniform 0.1;
}
maxZ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ logProfileDissipationRateInletFvPatchScalarField::logProfileDissipationRateInlet
:
fixedValueFvPatchScalarField(p, iF),
UfreeStream_(0.0),
uDirection_(0.0,0.0,0.0),
inputWindHeight_Veg_(0),
z0_(0),
Rd_(0),
Expand All @@ -64,6 +65,7 @@ logProfileDissipationRateInletFvPatchScalarField::logProfileDissipationRateInlet
:
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
UfreeStream_(ptf.UfreeStream_),
uDirection_(ptf.uDirection_),
inputWindHeight_Veg_(ptf.inputWindHeight_Veg_),
z0_(ptf.z0_),
Rd_(ptf.Rd_),
Expand All @@ -81,6 +83,7 @@ logProfileDissipationRateInletFvPatchScalarField::logProfileDissipationRateInlet
:
fixedValueFvPatchScalarField(p, iF),
UfreeStream_(readScalar(dict.lookup("UfreeStream"))),
uDirection_(dict.lookup("uDirection")),
inputWindHeight_Veg_(readScalar(dict.lookup("inputWindHeight_Veg"))),
z0_(readScalar(dict.lookup("z0"))),
Rd_(readScalar(dict.lookup("Rd"))),
Expand Down Expand Up @@ -174,6 +177,7 @@ logProfileDissipationRateInletFvPatchScalarField::logProfileDissipationRateInlet
:
fixedValueFvPatchScalarField(fcvpvf, iF),
UfreeStream_(fcvpvf.UfreeStream_),
uDirection_(fcvpvf.uDirection_),
inputWindHeight_Veg_(fcvpvf.inputWindHeight_Veg_),
z0_(fcvpvf.z0_),
Rd_(fcvpvf.Rd_),
Expand Down Expand Up @@ -210,6 +214,8 @@ void logProfileDissipationRateInletFvPatchScalarField::write(Ostream& os) const
fvPatchScalarField::write(os);
os.writeKeyword("UfreeStream")
<< UfreeStream_ << token::END_STATEMENT << nl;
os.writeKeyword("uDirection")
<< uDirection_ << token::END_STATEMENT << nl;
os.writeKeyword("inputWindHeight_Veg")
<< inputWindHeight_Veg_ << token::END_STATEMENT << nl;
os.writeKeyword("z0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class logProfileDissipationRateInletFvPatchScalarField
scalar maxValue_; //Scalar Vmax

scalar UfreeStream_; // Free Stream Velocity
vector uDirection_;
scalar inputWindHeight_Veg_; // Input wind Height on top of Vegetation
scalar z0_; // Roughness Parameters
scalar Rd_; //Zero plane displacement height
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ logProfileTurbulentKineticEnergyInletFvPatchScalarField::logProfileTurbulentKine
:
fixedValueFvPatchScalarField(p, iF),
UfreeStream_(0.0),
uDirection_(0.0,0.0,0.0),
inputWindHeight_Veg_(0),
z0_(0),
Rd_(0),
Expand All @@ -64,6 +65,7 @@ logProfileTurbulentKineticEnergyInletFvPatchScalarField::logProfileTurbulentKine
:
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
UfreeStream_(ptf.UfreeStream_),
uDirection_(ptf.uDirection_),
inputWindHeight_Veg_(ptf.inputWindHeight_Veg_),
z0_(ptf.z0_),
Rd_(ptf.Rd_),
Expand All @@ -81,6 +83,7 @@ logProfileTurbulentKineticEnergyInletFvPatchScalarField::logProfileTurbulentKine
:
fixedValueFvPatchScalarField(p, iF),
UfreeStream_(readScalar(dict.lookup("UfreeStream"))),
uDirection_(dict.lookup("uDirection")),
inputWindHeight_Veg_(readScalar(dict.lookup("inputWindHeight_Veg"))),
z0_(readScalar(dict.lookup("z0"))),
Rd_(readScalar(dict.lookup("Rd"))),
Expand Down Expand Up @@ -173,6 +176,7 @@ logProfileTurbulentKineticEnergyInletFvPatchScalarField::logProfileTurbulentKine
:
fixedValueFvPatchScalarField(fcvpvf, iF),
UfreeStream_(fcvpvf.UfreeStream_),
uDirection_(fcvpvf.uDirection_),
inputWindHeight_Veg_(fcvpvf.inputWindHeight_Veg_),
z0_(fcvpvf.z0_),
Rd_(fcvpvf.Rd_),
Expand Down Expand Up @@ -214,6 +218,8 @@ void logProfileTurbulentKineticEnergyInletFvPatchScalarField::write(Ostream& os)
fvPatchScalarField::write(os);
os.writeKeyword("UfreeStream")
<< UfreeStream_ << token::END_STATEMENT << nl;
os.writeKeyword("uDirection")
<< uDirection_ << token::END_STATEMENT << nl;
os.writeKeyword("inputWindHeight_Veg")
<< inputWindHeight_Veg_ << token::END_STATEMENT << nl;
os.writeKeyword("z0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class logProfileTurbulentKineticEnergyInletFvPatchScalarField
scalar maxValue_; //Scalar Vmax

scalar UfreeStream_; // Free Stream Velocity
vector uDirection_;
scalar inputWindHeight_Veg_; // Input wind Height on top of Vegetation
scalar z0_; // Roughness Parameters
scalar Rd_; //Zero plane displacement height
Expand Down

0 comments on commit d2b8014

Please sign in to comment.