![]() |
Did you recompile when you added the info lines? Your alfAvg is not updating bc you have competing things -- one volScalarField (declared in createFields.H) that is not getting updated. Then the scalar alfAvg at the end of the PIMPLE loop. I'm surprised this even compiled -- oh, I see that they're slightly different in name. So, to be clear, you should have alfAvg and Tsol computed before using in Teqn.H to be safe and sure that they're updated. Thus :
Code:
Code:
scalar alfAvg = gSum(alpha*mesh.V())/mesh.nCells() Caelan |
with this gSum, I get this compiling error:
Code:
pimpleFoam.C:91:37: error: no matching function for call to 'gSum(Foam::tmp<Foam::DimensionedField<double, Foam::volMesh> >)' alpha is changing correctly with time. |
How do you create alpha? That will affect how we reference/use it.
Caelan |
alpha is defined in TEqn as this (last line):
Code:
fvScalarMatrix TEqn |
Is it a volScalarField? I've got another idea -- lets try using an OF function :
Code:
scalar alfAvg = (fvc::domainIntegrate(alpha)/mesh.nCells()).value() Caelan |
yes it is a volScalarField.
with the new averageing I get this compilation error: Code:
pimpleFoam.C:92:59: error: cannot convert 'Foam::dimensioned<double>' to 'Foam::scalar {aka double}' in initialization |
sorry for my mistake. I applied alfAvg definition wrongly. Now it's running. will post you the update soon.
|
Oh I see -- it looks to be complaining about
Code:
mesh.nCells() Looks like it actually is a label instead of a scalar. Oops. Realizing that you've already defined alpha as a volScalarField : Code:
scalar alfAvg = fvc::domainIntegratte(alpha).value()/alpha.size() Caelan |
I think it's going to start.:)
for initial file of Tsol what do you suggest? Code:
cannot find file "C:/PROGRA~1/BLUECF~1/ofuser-of5/run/solidif/0/Tsol" cheers |
If you use Tsol as a dimensionedScalar you should not need it in createFields (defined as a volScalarField that must be read). If it is a volScalarField like alpha then you can just use something like :
Code:
Caelan |
Daer Caelan,
None of the above definitions for alfAvg give me the corrsct Volume Avarged alpha. Code:
scalar alfAvg = fvc::domainIntegratte(alpha).value()/alpha.size()scalar Basically iit should be as alfAvg=int(alpha, dV)/V could you please check and confirm? |
I'm not sure why it's not working, but if you know the correct value -- how are you calculating it? How do you know that the calculated value is wrong?
Caelan |
Here, based on domain integrate, the calculated value is close to zero (1e-9).
but using volFieldValue as a functionObject, the obtained alfAvg was accurate (varying smoothly from 1 to 0.8). This is my understanding based on the physics of the problem. by the way Code:
alfAvg = gSum(alpha*mesh.V())/mesh.nCells() Code:
solidFoam.C:93:41: error: no matching function for call to 'gSum(Foam::tmp <Foam::DimensionedField<double, Foam::volMesh> >)' |
A few basic questions, then. Have you inspected alpha visually (eg in paraview)? Does it match what you compute with the function object? I don't know offhand why you're getting the error -- I've used gsum before without error. It looks like the error you provided has been cut off. Have you inspected the function object code? What happens there?
Caelan |
Yes Actually I use parafoam to visualize the results.
when alpha is correct, (keeping all parameters controlled), the above formula doesn't give me the correct average value for alpha. It always shows very small numbers,(e.g. 1e-9). I'm thinking the above formula of " scalar alfAvg =...." does not show the correct volume-averaged of alpha. . |
Alright -- not sure why domainIntegrate wasn't working for you, but I think I found another solution. I replicated the error you got related to compilation of
Code:
gSum(alpha*mesh.V() Code:
mesh.cellVolumes() So lets try Code:
scalar alfAvg = gSum(alpha*mesh.cellVolumes())/alpha.size() Caelan |
It was fixed this way:
Code:
scalar alfInt = fvc::domainIntegrate(alpha).value() Thanks a lot Caelan for your support.:):) Without your help, this part of the work could take a couple of months longer. |
Guess there are many ways to Rome -- glad you figured out another solution.
Caelan |
All times are GMT -4. The time now is 17:20. |