|
[Sponsors] |
Actuator Disk model using Variable scaling method v2006 |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 14, 2020, 05:27 |
Actuator Disk model using Variable scaling method v2006
|
#1 |
Member
Kabir Shariff
Join Date: Oct 2016
Location: France
Posts: 53
Rep Power: 10 |
Hello Foamers,
I am working on simulation of tidal turbine using actuator disk with Openfoam, I use the FROUDE method and it works well with good results. I now want to use the VARIABLE SCALING METHOD that is recently added to OF v2006 release. When I use the method, I have this error. The reason for using this model is that it will allow me define the thrust force based on disk location, not the free sream velocity. In a system of turbine cluster, the free stream velocity is not consistent with turbines downstream. Code:
--> FOAM FATAL ERROR: [2] Velocity spatial-averaged on actuator disk is zero. Please check if the initial U field is zero. [2] [2] From void Foam::fv::actuationDiskSource::calcVariableScalingMethod(const AlphaFieldType&, const RhoFieldType&, Foam::fvMatrix<Foam::Vector<double> >&) [with AlphaFieldType = Foam::geometricOneField; RhoFieldType = Foam::geometricOneField] [2] in file sources/derived/actuationDiskSource/actuationDiskSourceTemplates.C at line 201. here if actuator disk code in fvOptions Code:
disk1 { type actuationDiskSource; variant variableScaling; selectionMode cellSet; cellSet actuationDisk1; diskArea 0.00785; diskDir (1 0 0); writeToFile true; sink true; Cp 0.47; Ct 0.7; monitorMethod points; monitorCoeffs { points ( (-0.5 0 0) ); } } Thank you |
|
December 15, 2020, 10:15 |
|
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
Hi,
The error message can be traced to actuationDiskSourceTemplates.C:199 Code:
if (mag(Udisk) < SMALL) { FatalErrorInFunction << "Velocity spatial-averaged on actuator disk is zero." << nl << "Please check if the initial U field is zero." << exit(FatalError); } Code:
// Calibrated thrust/power coeffs from power/thrust curves (LSRMTK:Eq. 6) const scalar CtStar = Ct*sqr(magUref/magUdisk); const scalar CpStar = Cp*pow3(magUref/magUdisk); Please see if your simulation settings are correct (since you are not allowed to have zero spatial-averaged flow speed on the rotor disk). Otherwise, if you would have any other suggestion or think that there is a bug somewhere, please issue a bug ticket in GitLab.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
March 9, 2021, 08:25 |
|
#3 | |
Member
Kabir Shariff
Join Date: Oct 2016
Location: France
Posts: 53
Rep Power: 10 |
Quote:
Hello, Thank you for the response, I have set a value to the internal field and the simulation is running. The U internalField is a global value that is applied in the entire domain. I want to simulate multiple turbines using the variable scaling method, I have defined the turbine location using topoSets and created corresponding actuationDiskSource for each turbine in fvoptions. My question is how do I define the Udisk to be selected based on topoSet defined? Below is the code for calculating the thrust force using variable scaling method Code:
template<class AlphaFieldType, class RhoFieldType> void Foam::fv::actuationDiskSource::calcVariableScalingMethod ( const AlphaFieldType& alpha, const RhoFieldType& rho, fvMatrix<vector>& eqn ) { const vectorField& U = eqn.psi(); vectorField& Usource = eqn.source(); const scalarField& cellsV = mesh_.V(); // Monitor and average monitor-region U and rho vector Uref(Zero); scalar rhoRef = 0.0; label szMonitorCells = monitorCells_.size(); for (const auto& celli : monitorCells_) { Uref += U[celli]; rhoRef = rhoRef + rho[celli]; } reduce(Uref, sumOp<vector>()); reduce(rhoRef, sumOp<scalar>()); reduce(szMonitorCells, sumOp<label>()); if (szMonitorCells == 0) { FatalErrorInFunction << "No cell is available for incoming velocity monitoring." << exit(FatalError); } Uref /= szMonitorCells; const scalar magUref = mag(Uref); rhoRef /= szMonitorCells; // Monitor and average U and rho on actuator disk vector Udisk(Zero); scalar rhoDisk = 0.0; scalar totalV = 0.0; for (const auto& celli : cells_) { Udisk += U[celli]*cellsV[celli]; rhoDisk += rho[celli]*cellsV[celli]; totalV += cellsV[celli]; } reduce(Udisk, sumOp<vector>()); reduce(rhoDisk, sumOp<scalar>()); reduce(totalV, sumOp<scalar>()); if (totalV < SMALL) { FatalErrorInFunction << "No cell in the actuator disk." << exit(FatalError); } Udisk /= totalV; const scalar magUdisk = mag(Udisk); rhoDisk /= totalV; if (mag(Udisk) < SMALL) { FatalErrorInFunction << "Velocity spatial-averaged on actuator disk is zero." << nl << "Please check if the initial U field is zero." << exit(FatalError); } // Interpolated thrust/power coeffs from power/thrust curves const scalar Ct = sink_*UvsCtPtr_->value(magUref); const scalar Cp = sink_*UvsCpPtr_->value(magUref); if (Cp <= VSMALL || Ct <= VSMALL) { FatalErrorInFunction << "Cp and Ct must be greater than zero." << nl << "Cp = " << Cp << ", Ct = " << Ct << exit(FatalIOError); } // Calibrated thrust/power coeffs from power/thrust curves (LSRMTK:Eq. 6) const scalar CtStar = Ct*sqr(magUref/magUdisk); const scalar CpStar = Cp*pow3(magUref/magUdisk); // Compute calibrated thrust/power (LSRMTK:Eq. 5) const scalar T = 0.5*rhoRef*diskArea_*magSqr(Udisk & diskDir_)*CtStar; const scalar P = 0.5*rhoRef*diskArea_*pow3(mag(Udisk & diskDir_))*CpStar; for (const label celli : cells_) { Usource[celli] += (cellsV[celli]/totalV*T)*diskDir_; } if ( mesh_.time().timeOutputValue() >= writeFileStart_ && mesh_.time().timeOutputValue() <= writeFileEnd_ ) { Ostream& os = file(); writeCurrentTime(os); os << Uref << tab << Cp << tab << Ct << tab << Udisk << tab << CpStar << tab << CtStar << tab << T << tab << P << endl; } } |
||
October 16, 2021, 18:45 |
|
#4 |
Member
Hüseyin Can Önel
Join Date: Sep 2018
Location: Ankara, Turkey
Posts: 47
Rep Power: 8 |
Hi Kbshariff,
I am also interested in the newly introduced Variable Scaling AD model. This question might be irrelevant to the topic but, have you tried using the Variable Scaling AD in yawed configuration or in any other configuration where the swept disk area is not aligned with the cells? Regards, Huseyin |
|
Tags |
actuationdisk, fvoptions,momentum source, v2006, variablescaling |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
hello Evry body please i want to used vof method and k-omega sst turbulence model fo | luca007 | FLUENT | 4 | February 20, 2017 10:17 |
Error finding variable "THERMX" | sunilpatil | CFX | 8 | April 26, 2013 08:00 |
error in COMSOL:'ERROR:6164 Duplicate Variable' | bhushas | COMSOL | 1 | May 30, 2008 05:35 |
Env variable not set | gruber2 | OpenFOAM Installation | 5 | December 30, 2005 05:27 |
Fortran variable ED for K-OMEGA model | Viatcheslav Anissimov | CFX | 0 | August 31, 2000 07:41 |