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

adding a constant volumetric source term to transport equation in a particular region

Register Blogs Community New Posts Updated Threads Search

Like Tree33Likes
  • 2 Post By cfdonline2mohsen
  • 4 Post By zfaraday
  • 1 Post By Cyp
  • 8 Post By fabian_roesler
  • 1 Post By cfdonline2mohsen
  • 3 Post By fabian_roesler
  • 2 Post By Cyp
  • 8 Post By ARTem
  • 1 Post By Cyp
  • 3 Post By michall

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   November 17, 2014, 05:02
Smile adding a constant volumetric source term to transport equation in a particular region
  #1
Senior Member
 
cfdonline2mohsen's Avatar
 
Mohsen KiaMansouri
Join Date: Jan 2010
Location: CFD Lab
Posts: 118
Rep Power: 16
cfdonline2mohsen is on a distinguished road
Dear Foamers
Hi!

I want to add a constant volumetric source term to the scalar transport equation which acts only in a particular volumetric region of the domain.

I modified the scalar transport equation as follows:
Code:
solve
	(
	  fvm::ddt(T)
	  + fvm::div(phi, T)
	  - fvm::laplacian(DT, T)
	  ==
	  sourceValue
	);
Then I defined the sourceValue in the createFields.H file as follows:

Code:
dimensionedScalar sourceValue(twoPhaseProperties.lookup("sourceValue"));
It will read the sourceValue from the transportProperties file of my case. In the transportProperties file,I gave the sourceValue as follows:

Code:
sourceValue      sourceValue [0 0 -1 0 0 0 0] 0.42;
By using this approach, the sourceValue=0.42 is used for the entire domain but I want to use the sourceValue=0.42 for only a specific volumetric region inside my domain.

I have two questions:

1) How can I define this volumetric region inside my domain? is there any utility?

2) How can I change the transportProperties file to consider sourceValue=0.42 only for this specific volumetric region and sourceValue=0 for the rest of the domain?


Any help in this regard would be much appreciated.
Thank you so much in advance.
BlnPhoenix and Luttappy like this.
__________________
“If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if you have an idea and I have an idea and we exchange these ideas, then each of us will have two ideas.”
cfdonline2mohsen is offline   Reply With Quote

 


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
[swak4Foam] funkySetFields compilation error tayo OpenFOAM Community Contributions 39 December 3, 2012 05:18
How to write UDF to add a source term to the new transport equation ? 89566008 Fluent UDF and Scheme Programming 2 October 22, 2012 07:23
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 11:44
Source Term on Scalar Transport Equation alessio.nz OpenFOAM Programming & Development 9 January 31, 2011 07:56
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 08:19


All times are GMT -4. The time now is 16:53.