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

passive scalar increases

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree5Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   May 23, 2013, 15:21
Default
  #21
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
thank you for your full clarification.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   May 25, 2013, 16:16
Default
  #22
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
Hi again!
and what will be the proper code for an incompressible case? I wrote sp(rho,gas) in pimpleFoam and it got an error and when removed rho from equation in got another error:an Error in compiling:Foam::zeroField Foam::fvm::Sp(const Foam::zero&, const Foam
so whats the correct equation?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   May 26, 2013, 04:17
Default
  #23
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,089
Blog Entries: 6
Rep Power: 19
Tobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by immortality View Post
Hi again!
and what will be the proper code for an incompressible case? I wrote sp(rho,gas) in pimpleFoam and it got an error and when removed rho from equation in got another error:an Error in compiling:Foam::zeroField Foam::fvm::Sp(const Foam::zero&, const Foam
so whats the correct equation?

Hi

Code:
ddt(phi, gas)
should work
Tobi is offline   Reply With Quote

Old   May 26, 2013, 05:30
Default
  #24
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
Hi,sure it needs to be modified:
Code:
fvScalarMatrix gasEqn
	(
	  fvm::ddt(phi,gas)
         -fvm::Sp(phi, gas)
         +fvm::div(phi, gas)
         -fvm::Sp(fvc::div(phi), gas)
         -fvm::laplacian(turbulence->nuEff(), gas)
	);
	
	gasEqn.relax();
	gasEqn.solve(mesh.solver("gas"));
this error occurred:
Code:
Making dependency list for source file pimpleFoamModified.C
SOURCE=pimpleFoamModified.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam220/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam220/src/transportModels -I/opt/openfoam220/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/openfoam220/src/finiteVolume/lnInclude -I/opt/openfoam220/src/meshTools/lnInclude -I/opt/openfoam220/src/fvOptions/lnInclude -I/opt/openfoam220/src/sampling/lnInclude -IlnInclude -I. -I/opt/openfoam220/src/OpenFOAM/lnInclude -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/pimpleFoamModified.o
In file included from pimpleFoamModified.C:89:0:
gasEqn.H: In function ‘int main(int, char**)’:
gasEqn.H:5:20: error: no matching function for call to ‘ddt(Foam::surfaceScalarField&, Foam::volScalarField&)’
gasEqn.H:5:20: note: candidates are:
/opt/openfoam220/src/finiteVolume/lnInclude/fvmDdt.C:45:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::ddt(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmDdt.C:60:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::ddt(const Foam::one&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmDdt.C:72:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::ddt(const dimensionedScalar&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmDdt.C:88:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::ddt(const volScalarField&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
gasEqn.H:6:27: error: no matching function for call to ‘Sp(Foam::surfaceScalarField&, Foam::volScalarField&)’
gasEqn.H:6:27: note: candidates are:
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:100:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const Foam::DimensionedField<double, Foam::volMesh>&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:126:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:140:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:154:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const dimensionedScalar&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:180:1: note: template<class Type> Foam::zeroField Foam::fvm::Sp(const Foam::zero&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
make: *** [Make/linux64GccDPOpt/pimpleFoamModified.o] Error 1
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   May 26, 2013, 13:18
Default
  #25
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,089
Blog Entries: 6
Rep Power: 19
Tobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Sorry... my fault:

Code:
fvm::ddt(gas)
Tobi is offline   Reply With Quote

Old   May 26, 2013, 13:52
Default
  #26
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
Hi tobias
I changed it:
Code:
fvScalarMatrix gasEqn
	(
	  fvm::ddt(gas)
         -fvm::Sp(phi, gas)
         +fvm::div(phi, gas)
         -fvm::Sp(fvc::div(phi), gas)
         -fvm::laplacian(turbulence->nuEff(), gas)
	);
	
	gasEqn.relax();
	gasEqn.solve(mesh.solver("gas"));
but the error persists:
Code:
ehsan@Ehsan-com:~/Desktop/Solvers/pimpleFoamModified$ wmake
Making dependency list for source file pimpleFoamModified.C
SOURCE=pimpleFoamModified.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam220/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam220/src/transportModels -I/opt/openfoam220/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/openfoam220/src/finiteVolume/lnInclude -I/opt/openfoam220/src/meshTools/lnInclude -I/opt/openfoam220/src/fvOptions/lnInclude -I/opt/openfoam220/src/sampling/lnInclude -IlnInclude -I. -I/opt/openfoam220/src/OpenFOAM/lnInclude -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/pimpleFoamModified.o
In file included from pimpleFoamModified.C:89:0:
gasEqn.H: In function ‘int main(int, char**)’:
gasEqn.H:6:27: error: no matching function for call to ‘Sp(Foam::surfaceScalarField&, Foam::volScalarField&)’
gasEqn.H:6:27: note: candidates are:
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:100:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const Foam::DimensionedField<double, Foam::volMesh>&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:126:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:140:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:154:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::Sp(const dimensionedScalar&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/opt/openfoam220/src/finiteVolume/lnInclude/fvmSup.C:180:1: note: template<class Type> Foam::zeroField Foam::fvm::Sp(const Foam::zero&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
make: *** [Make/linux64GccDPOpt/pimpleFoamModified.o] Error 1
maybe the Sp term should be removed?
I don't know yet exactly when we have to use Sp term.could you please clarify again for me?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   December 25, 2013, 11:46
Default
  #27
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
Hi dear Tobias
this link has been broken,could you give me another link for referencing? thanks.
http://www.holzmann-cfd.de/index.php...rische-schemen
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   December 25, 2013, 13:03
Default
  #28
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,312
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings to all!

@Ehsan:
Quote:
Originally Posted by immortality View Post
Hi dear Tobias
this link has been broken,could you give me another link for referencing? thanks.
http://www.holzmann-cfd.de/index.php...rische-schemen
If think the new link is this one: http://www.holzmann-cfd.de/index.php/numerische-schemen

Best regards,
Bruno
Tobi likes this.
wyldckat is offline   Reply With Quote

Old   December 25, 2013, 13:03
Default
  #29
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,089
Blog Entries: 6
Rep Power: 19
Tobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi Ehsan,

here is the actual link:

http://www.holzmann-cfd.de/index.php/numerische-schemen
wyldckat likes this.
Tobi is offline   Reply With Quote

Old   January 13, 2014, 11:52
Default
  #30
TBO
Member
 
Join Date: May 2013
Location: Netherlands
Posts: 30
Rep Power: 4
TBO is on a distinguished road
Quote:
Originally Posted by Tobi View Post
For that I build a new one with two different densitys (not tested).
Hi Tobi,

A while ago you also mentioned this solution to me on the libOpenSmoke forum. However I think it is more appropriate to ask you here, since this is about the scalar solver. Can you share your solver with two different densities for the mixing of air and methane? As background, I want to model the mixing of a fuel (methane) with air.

Regards,
TBO is offline   Reply With Quote

Old   January 14, 2014, 12:38
Default
  #31
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
Hi dear Tobias,
for an unsteady flow,are these schemes appropriate?is bounded scheme suitable for ddt(rho,gas)? the results seemed fine and now I noticed about maybe excess "bounded" term in schemes.are they OK in your opinion?
Code:
  ddtSchemes
{
    default         none;
    ddt(rho)        CrankNicolson .5;
    ddt(rhoU)       CrankNicolson .5;
    ddt(rhoE)       CrankNicolson .5;
    ddt(rho,U)      CrankNicolson .5;
    ddt(rho,e)      CrankNicolson .5;
    ddt(rho,h)      CrankNicolson .5;
    ddt(rho,k)      bounded CrankNicolson .5;
    ddt(rho,omega)  bounded CrankNicolson .5;
    ddt(rho,epsilon) bounded CrankNicolson .5;
    ddt(rho,gas)    bounded CrankNicolson .5;
}


  divSchemes
{
    default none;
    div(tauMC) Gauss linear;
    div(phi,k) bounded Gauss upwind;
    div(phi,omega) bounded Gauss upwind;
    div(phi,epsilon) bounded Gauss upwind;
    div(phi,gas) bounded Gauss limitedLimitedLinear 1 0 1;
}
and its the transport equation:
Code:
     // --- Scalar Transport( Solving equation of variance of mixture fraction )
      tmp<fvScalarMatrix> gasEqn
      (
       fvm::ddt(rho,gas)
        -fvm::Sp(fvc::ddt(rho), gas) 
        +fvm::div(phi, gas)
        -fvm::Sp(fvc::div(phi), gas)
        -fvm::laplacian(turbulence->muEff(), gas)                
      );
      
      gasEqn().relax();
      gasEqn().solve(mesh.solver("gas"));
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   January 14, 2014, 13:32
Default
  #32
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,089
Blog Entries: 6
Rep Power: 19
Tobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by TBO View Post
Hi Tobi,

A while ago you also mentioned this solution to me on the libOpenSmoke forum. However I think it is more appropriate to ask you here, since this is about the scalar solver. Can you share your solver with two different densities for the mixing of air and methane? As background, I want to model the mixing of a fuel (methane) with air.

Regards,
Hi,

yes I have that solver - anywhere on my Harddisc -

Is it possible that you share your results?
Regards Tobi

PS: Further answer to the schemes is comming (no time at the moment)
Tobi is offline   Reply With Quote

Old   January 23, 2014, 09:47
Default
  #33
TBO
Member
 
Join Date: May 2013
Location: Netherlands
Posts: 30
Rep Power: 4
TBO is on a distinguished road
Quote:
Originally Posted by Tobi View Post

yes I have that solver - anywhere on my Harddisc -

Is it possible that you share your results?
Regards Tobi
Hi Tobi,

I would be very happy to test this solver, since it would help a lot to model a steady state mixing of gases with different densities. My main goal is to run combustion simulations (with the use of libOpenSmoke/ flameletSimple/PisoFOam). However as step before and to assess nozzle designs I would like to model fuel and air mixing without chemical reactions involved, for this the scalar solver could be very helpful, since steady state is almost the only option.

The simulations I am doing on real geometries are strictly confidential, so there is no way of sharing them . For the cold flow mixing I will also run some academic cases (when I have time...) and it should be possible to share some of those results.

Mit freundlichen Grüßen,
TBO is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
dieselFoam problem!! trying to introduce a new heat transfer model vivek070176 OpenFOAM Programming & Development 10 December 24, 2014 00:48
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 01:47
whats the cause of error? immortality OpenFOAM Running, Solving & CFD 11 April 22, 2014 12:32
is internalField(U) equivalent to zeroGradient? immortality OpenFOAM Running, Solving & CFD 7 March 29, 2013 02:27
passive scalar for carbon monoxide kraizy STAR-CCM+ 0 October 12, 2009 20:13


All times are GMT -4. The time now is 19:50.