CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

define different mass diffusion coefficient in different zones

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 5, 2019, 10:47
Default define different mass diffusion coefficient in different zones
  #1
Senior Member
 
Weiqiang Liu
Join Date: Feb 2018
Posts: 278
Rep Power: 9
Weiqiang Liu is on a distinguished road
Hi all,

I am trying to assign different mass diffusion coefficients in different zones. I use DEFINE_DIFFUSIVITY.

In porous zone, mass diffusion coefficient is a combination of molecular and knudsen coefficient while in other fluid zone, mass diffusion is just molecular diffusion calculated by kinetic theory.

I attached my code here. I spend a while to check my code. However, it's still can not be loaded with some error. I think fluent only check syntax of the code no matter the logic is right or wrong.

Can anybody help me to check my code? I am very new to UDF.

Thanks very much!

Weiqiang
Attached Files
File Type: c new diffusivity.c (4.5 KB, 20 views)
Weiqiang Liu is offline   Reply With Quote

Old   March 4, 2022, 05:18
Default Diffusivity UDF
  #2
New Member
 
Joe
Join Date: Jan 2022
Posts: 13
Rep Power: 4
CFD27 is on a distinguished road
Hello all,
I have a similar problem as Weiqiang Liu. I want to define two different diffusion coefficients in two different cell zones. For this I use the following UDF:
Code:
DEFINE_DIFFUSIVITY(diffusivity, c, t, i)
{
	Domain* d;
	Thread * tc1, * tc2;

	d = Get_Domain(1);
	
	tc1 = Lookup_Thread(d, 8);
	tc2 = Lookup_Thread(d, 9);


	if (t == tc1)
	{
		diffusivity = 1e-7;
	}
	else if (t == tc2)
	{
		diffusivity = 1e-5;
	}
	return diffusivity;
	
}
The UDF compiles without any problems. However, you can see in the post that the diffusion coefficients are not inserted correctly. Does anyone have an idea what this can be due to?
Many thanks in advance.
Many greetings
Joe
Attached Images
File Type: png Diffusivity.png (108.7 KB, 13 views)
CFD27 is offline   Reply With Quote

Old   April 1, 2022, 08:46
Default
  #3
New Member
 
juan hincapie
Join Date: Apr 2022
Posts: 1
Rep Power: 0
juanfelipehincapie is on a distinguished road
Did you finally figure out how to solve this problem? I'm trying to fix a diffusion value in a porous zone. I dont know how to do it.
juanfelipehincapie is offline   Reply With Quote

Reply

Tags
effective diffusion, mass diffusion, udf


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
HELP----Surface Reaction UDF Ashi Fluent UDF and Scheme Programming 1 May 19, 2020 21:13
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 05:21
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion faizan_habib7 CFX 4 February 1, 2016 17:00
Low Mixing time Problem Mavier CFX 5 April 29, 2013 00:00
question about how to define diffusion coefficient in CFX rystokes CFX 0 December 12, 2009 05:32


All times are GMT -4. The time now is 05:48.