CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Modify SemiImplicitSource for time varying source

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 20, 2020, 10:21
Default Modify SemiImplicitSource for time varying source
  #1
New Member
 
Sagar
Join Date: Apr 2016
Posts: 23
Rep Power: 10
ksgr is on a distinguished road
Hello all!
I am trying to model a time varying mass source with reactingParcelFoam solver. I basically want to see what happens when the compactness of the source changes to the evolution of the species. For this I have removed the source which is computed from the evaporation of the parcels in the OpenFoam. I am trying to use fvOptions to multiply the source with sinusoid to make it vary in the time domain.

To add sin function, I am trying to add the sin(Time) to Su in the source file. I copied the SemiImplicitSource source files to my local working directory and then changed the file names to sineSource.C and sineSource.H and made changes accordingly everywhere including the Make folder. However, when I try to compile I get the following error
Code:
sources/general/sineSource/sineSource.C:38:18: error: redefinition of ‘const wordList Foam::fv::sineSource<Type>::volumeModeTypeNames_’
     IStringStream("(absolute specific)")()
                  ^
In file included from sources/general/sineSource/sineSource.H:221:0,
                 from sources/general/sineSource/sineSource.C:27:
sources/general/sineSource/sineSource.C:36:22: note: ‘const wordList Foam::fv::sineSource<Type>::volumeModeTypeNames_’ previously declared here
 const Foam::wordList Foam::fv::sineSource<Type>::volumeModeTypeNames_
                      ^~~~
sources/general/sineSource/sineSource.C:46:1: error: redefinition of ‘Foam::fv::sineSource<Type>::volumeModeType Foam::fv::sineSource<Type>::wordToVolumeModeType(const Foam::word&) const’
 Foam::fv::sineSource<Type>::wordToVolumeModeType
 ^~~~
In file included from sources/general/sineSource/sineSource.H:221:0,
                 from sources/general/sineSource/sineSource.C:27:
sources/general/sineSource/sineSource.C:46:1: note: ‘Foam::fv::sineSource<Type>::volumeModeType Foam::fv::sineSource<Type>::wordToVolumeModeType(const Foam::word&) const’ previously declared here
 Foam::fv::sineSource<Type>::wordToVolumeModeType
 ^~~~
sources/general/sineSource/sineSource.C:69:12: error: redefinition of ‘Foam::word Foam::fv::sineSource<Type>::volumeModeTypeToWord(const Foam::fv::sineSource<Type>::volumeModeType&) const’
 Foam::word Foam::fv::sineSource<Type>::volumeModeTypeToWord
            ^~~~
In file included from sources/general/sineSource/sineSource.H:221:0,
                 from sources/general/sineSource/sineSource.C:27:
sources/general/sineSource/sineSource.C:69:12: note: ‘Foam::word Foam::fv::sineSource<Type>::volumeModeTypeToWord(const Foam::fv::sineSource<Type>::volumeModeType&) const’ previously declared here
 Foam::word Foam::fv::sineSource<Type>::volumeModeTypeToWord
            ^~~~
sources/general/sineSource/sineSource.C:86:6: error: redefinition of ‘void Foam::fv::sineSource<Type>::setFieldData(const Foam::dictionary&)’
 void Foam::fv::sineSource<Type>::setFieldData(const dictionary& dict)
      ^~~~
In file included from sources/general/sineSource/sineSource.H:221:0,
                 from sources/general/sineSource/sineSource.C:27:
sources/general/sineSource/sineSource.C:86:6: note: ‘void Foam::fv::sineSource<Type>::setFieldData(const Foam::dictionary&)’ previously declared here
 void Foam::fv::sineSource<Type>::setFieldData(const dictionary& dict)
      ^~~~
sources/general/sineSource/sineSource.C:112:1: error: redefinition of ‘Foam::fv::sineSource<Type>::sineSource(const Foam::word&, const Foam::word&, const Foam::dictionary&, const Foam::fvMesh&)’
 Foam::fv::sineSource<Type>::sineSource
 ^~~~
In file included from sources/general/sineSource/sineSource.H:221:0,
                 from sources/general/sineSource/sineSource.C:27:
sources/general/sineSource/sineSource.C:112:1: note: ‘Foam::fv::sineSource<Type>::sineSource(const Foam::word&, const Foam::word&, const Foam::dictionary&, const Foam::fvMesh&)’ previously declared here
 Foam::fv::sineSource<Type>::sineSource
 ^~~~
sources/general/sineSource/sineSource.C:132:6: error: redefinition of ‘void Foam::fv::sineSource<Type>::addSup(Foam::fvMatrix<Type>&, Foam::label)’
 void Foam::fv::sineSource<Type>::addSup
      ^~~~
In file included from sources/general/sineSource/sineSource.H:221:0,
                 from sources/general/sineSource/sineSource.C:27:
sources/general/sineSource/sineSource.C:132:6: note: ‘virtual void Foam::fv::sineSource<Type>::addSup(Foam::fvMatrix<Type>&, Foam::label)’ previously declared here
 void Foam::fv::sineSource<Type>::addSup
      ^~~~
sources/general/sineSource/sineSource.C:195:6: error: redefinition of ‘void Foam::fv::sineSource<Type>::addSup(const volScalarField&, Foam::fvMatrix<Type>&, Foam::label)’
 void Foam::fv::sineSource<Type>::addSup
      ^~~~
In file included from sources/general/sineSource/sineSource.H:221:0,
                 from sources/general/sineSource/sineSource.C:27:
sources/general/sineSource/sineSource.C:195:6: note: ‘virtual void Foam::fv::sineSource<Type>::addSup(const volScalarField&, Foam::fvMatrix<Type>&, Foam::label)’ previously declared here
 void Foam::fv::sineSource<Type>::addSup
      ^~~~
/home/sagar/OpenFOAM/OpenFOAM-4.x/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/sources/general/sineSource/sineSource.o' failed
make: *** [Make/linux64GccDPInt32Opt/sources/general/sineSource/sineSource.o] Error 1
I think that with the new sineSource type it is still referencing to the semiImplicitSource by the redefinition error. I am not so sure of it. I don't know whether any other changes needs to be made as this is a general source. Any help would be appreciated

Thank you
ksgr is offline   Reply With Quote

Reply

Tags
fvoptions mass source


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM.com] swak4foam compiling issues on a cluster saj216 OpenFOAM Installation 5 January 17, 2023 16:05
[Other] Tabulated thermophysicalProperties library chriss85 OpenFOAM Community Contributions 62 October 2, 2022 03:50
[Other] Adding solvers from DensityBasedTurbo to foam-extend 3.0 Seroga OpenFOAM Community Contributions 9 June 12, 2015 17:18
Trouble compiling utilities using source-built OpenFOAM Artur OpenFOAM Programming & Development 14 October 29, 2013 10:59
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 10:57


All times are GMT -4. The time now is 23:15.