changing a volScalarField to a dimensionedScalar
I've been working on creating a union between interFoam and mhdFoam. Today I made some major progress on getting all the variables aligned but i ran into a bit of a problem.
interFoam treats mu and nu as volScalarFields but in order to do the DB and DBU parts of MHD they have to be scalars.
Any thoughts on switching back and forth?
interFoam calculates nu and mu in the file twoPhaseMixture.H and it calculates them to be scalars. I'm using predefined functions to read them into CreateFields.H
Read in of mu and nu:
const volScalarField& mu = twoPhaseProperties.mu();
const volScalarField& nu = twoPhaseProperties.nu();
DB and DBU code:
dimensionedScalar DB = 1.0/(mu*sigma);
DB.name() = "DB";
dimensionedScalar DBU = 1.0/(2.0*(mu ^ rho));
DBU.name() = "DBU";
Any help or pointers are greatly appreciated :)
How do you want to represent an entire field of values with a single value? It's entirely up to you. You could take the average... I'd probably do that. Or take a reference point.
that worked well, I now have a value that appears to be the correct average. I've been coming across some problems getting the correct dimensions and I was wondering if there was a way to reset dimensions. I've tried resetting them using setDimensions but then it starts to get snippy.
Thanks in advance, Walter
To force the dimensions of a dimensionedScalar to change, use:
thanks, it worked like a charm!
Whatif I want to use the integrated value of the volScalarField instead of the average?
|All times are GMT -4. The time now is 09:37.|