|
[Sponsors] |
![]() |
![]() |
#61 | |
Member
saidc
Join Date: Feb 2020
Location: nowhere
Posts: 63
Rep Power: 6 ![]() |
Quote:
Hi Andrew, Thanks for your reply. Same output for single CPU, nothing changed. If I can be sure about that syntax is correct I'll try it on another system. Do you think the syntax is correct? Kind regards, Said. |
||
![]() |
![]() |
![]() |
![]() |
#62 | |
Senior Member
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13 ![]() |
Quote:
Code:
//{{{ begin code #line 36 "/mnt/c/Users/saidc/Desktop/codedTest/constant/fuelRodsRegion/fvOptions.codedSource" Pout<< "**codeCorrect**" << endl; //}}} end code Code:
//{{{ begin code - warn/fatal if not implemented? #line 41 "/mnt/c/Users/saidc/Desktop/codedTest/constant/fuelRodsRegion/fvOptions.codedSource" const scalarField& Zcoord = mesh.C().component(Vector::Z); scalarField& heSource = eqn.source(); forAll(Zcoord, i) { heSource += (0.00000444*pow(Zcoord[i],4)) - (0.00025507*pow(Zcoord[i],3)) + (0.00144848*pow(Zcoord[i],2)) + (0.07409711*Zcoord[i]) + 1.64833117; } //}}} end code Code:
//{{{ begin code - warn/fatal if not implemented? NotImplemented //}}} end code Code:
//{{{ begin code #line 51 "/mnt/c/Users/saidc/Desktop/codedTest/constant/fuelRodsRegion/fvOptions.codedSource" Pout<< "**codeCorrect**" << endl; //}}} end code I commented the code for you so that the syntax is correct but I doubt I could help with the functionality of this code, I haven' t looked over OF functions in a while. Code:
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2019-2021 OpenCFD Ltd. Copyright (C) YEAR AUTHOR, AFFILIATION ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. \*---------------------------------------------------------------------------*/ #include "codedFvOptionTemplate.H" #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "surfaceFields.H" #include "unitConversion.H" #include "fvMatrix.H" //{{{ begin codeInclude //}}} end codeInclude // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { namespace fv { // * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * // //{{{ begin localCode //}}} end localCode // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // // dynamicCode: // SHA1 = ecc90b05a445f885e6ec8482cb3441c896bd535d // // unique function name that can be checked if the correct library version // has been loaded extern "C" void sourceTime_ecc90b05a445f885e6ec8482cb3441c896bd535d(bool load) { if (load) { // Code that can be explicitly executed after loading } else { // Code that can be explicitly executed before unloading } } // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // defineTypeNameAndDebug(sourceTimeFvOptionscalarSource, 0); addRemovableToRunTimeSelectionTable ( option, sourceTimeFvOptionscalarSource, dictionary ); } // End namespace fv } // End namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::fv:: sourceTimeFvOptionscalarSource:: sourceTimeFvOptionscalarSource ( const word& name, const word& modelType, const dictionary& dict, const fvMesh& mesh ) : fv::cellSetOption(name, modelType, dict, mesh) { if (false) { printMessage("Construct sourceTime fvOption from dictionary"); } } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::fv:: sourceTimeFvOptionscalarSource:: ~sourceTimeFvOptionscalarSource() { if (false) { printMessage("Destroy sourceTime"); } } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::fv:: sourceTimeFvOptionscalarSource::correct ( GeometricField<scalar, fvPatchField, volMesh>& fld ) { if (false) { Info<< "sourceTimeFvOptionscalarSource::correct()\n"; } /*begin code #line 36 "/mnt/c/Users/saidc/Desktop/codedTest/constant/fuelRodsRegion/fvOptions.codedSource" Pout<< "**codeCorrect**" << endl; //}}} end code */ } void Foam::fv:: sourceTimeFvOptionscalarSource::addSup ( fvMatrix<scalar>& eqn, const label fieldi ) { if (false) { Info<< "sourceTimeFvOptionscalarSource::addSup()\n"; } /* //{{{ begin code - warn/fatal if not implemented? #line 41 "/mnt/c/Users/saidc/Desktop/codedTest/constant/fuelRodsRegion/fvOptions.codedSource" */ const scalarField& Zcoord = mesh.C().component(Vector::Z); scalarField& heSource = eqn.source(); forAll(Zcoord, i) { heSource += (0.00000444*pow(Zcoord[i],4)) - (0.00025507*pow(Zcoord[i],3)) + (0.00144848*pow(Zcoord[i],2)) + (0.07409711*Zcoord[i]) + 1.64833117; } //}}} end code } void Foam::fv:: sourceTimeFvOptionscalarSource::addSup ( const volScalarField& rho, fvMatrix<scalar>& eqn, const label fieldi ) { if (false) { Info<< "sourceTimeFvOptionscalarSource::addSup(rho)\n"; } /*{{{ begin code - warn/fatal if not implemented? NotImplemented //}}} end code */ } void Foam::fv:: sourceTimeFvOptionscalarSource::constrain ( fvMatrix<scalar>& eqn, const label fieldi ) { if (false) { Info<< "sourceTimeFvOptionscalarSource::constrain()\n"; } /* //{{{ begin code #line 51 "/mnt/c/Users/saidc/Desktop/codedTest/constant/fuelRodsRegion/fvOptions.codedSource" Pout<< "**codeCorrect**" << endl; //}}} end code */ } // ************************************************************************* // |
||
![]() |
![]() |
![]() |
Tags |
fvoptions, heat source, scalarcodedsource |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFoam 2.2 fvOptions temperature limits | fredo490 | OpenFOAM Running, Solving & CFD | 12 | January 16, 2020 23:59 |
Building a solver with fixedTemperatureConstraint using fvOptions | Fluido | OpenFOAM Programming & Development | 9 | February 15, 2018 00:30 |
How to set fvOptions | yurifrey | OpenFOAM Pre-Processing | 5 | February 22, 2016 18:14 |
[swak4Foam] Setting BC for a passive scalar (groovy vs fvOptions) | Tobi | OpenFOAM Community Contributions | 0 | May 23, 2013 14:53 |
A new Howto on the OpenFOAM Wiki Compiling OpenFOAM under Unix | mbeaudoin | OpenFOAM Installation | 2 | April 28, 2006 08:54 |