← Back to team overview

yade-users team mailing list archive

Re: [Question #702133]: How to implement temperature-dependent pressure calcs in Thermal and Flow Engines

 

Question #702133 on Yade changed:
https://answers.launchpad.net/yade/+question/702133

Zoheir Khademian posted a new comment:
Hey Robert,

Sorry for the late response. I was trying to make a weak coupling
between pressure and temperature.  I ended up slightly modifying [1] in
thermal.cpp to allow changes in dV rates due to temperature changes. I
know this function is for considering fluid expansion in the pressure
calculations, but I set beta=1 and then divide [2] by the current
temperature of the cell (cell->info().temp()). This way I assumed I have
an ideal gas with linear relationship between temperature and volume
changes. I recompiled and it seams to be working. I need to find a way
to validate the results though. What do you think?

Here is the modified function:
void ThermalEngine::computeCellVolumeChangeFromDeltaTemp(CellHandle& cell, Real /*cavDens*/)
{
	Real beta;
	if (tempDependentFluidBeta) beta = 7.5e-6 * cell->info().temp() + 5.7e-5; // linear model for thermal expansion
	else
		beta = fluidBeta;
	Real poreVolume;
	if (porosityFactor > 0) poreVolume = cell->info().volume() * porosityFactor; // allows us to simulate low porosity matrices
	else
		poreVolume = (1. / cell->info().invVoidVolume());
	//	else K = flow->fluidBulkModulus;
	if (!cell->info().isCavity) {
		cell->info().dv() += -poreVolume * cell->info().dtemp()/ cell->info().temp() / thermalDT;
	} else if (cell->info().isCavity) {
		cell->info().dv() += -(cell->info().volume()) * beta * cell->info().dtemp()
		        / thermalDT; // ignore the particles used for fluid discretization in the pore (i.e. use volume())
	}
}


>>If you wanted a strong coupling, I could advise you or implement it for you - but it would require significant development hours, and therefore, I would have little choice but to charge for that kind of software development.
Thanks for the offer. I shared this with Ryan. We might end up going that route at the end but for preliminary results a weak coupling should do. 

[1] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/pfv/Thermal.cpp#L739
[2] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/pfv/Thermal.cpp#L751

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.