Fixing externalWallHeatFluxTemperature mapping scalarFields.

Fixing humidityTemperatureCoupled problem in parallel
Adding Allrun-parallel to externalSolarLoad and windshieldCondensation tutorials
This commit is contained in:
sergio 2017-06-14 13:58:52 -07:00
parent 8a8e5e8891
commit b083205d23
10 changed files with 131 additions and 53 deletions

View File

@ -31,11 +31,7 @@
fvm::laplacian(rhorAUf, p_rgh) == fvc::div(phiHbyA)
);
p_rghEqn.setReference
(
pRefCell,
compressible ? getRefCellValue(p_rgh, pRefCell) : pRefValue
);
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
p_rghEqn.solve();
@ -76,8 +72,9 @@
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);
p_rgh = p - rho*gh;
}
p_rgh = p - rho*gh;
}
rho = thermo.rho();

View File

@ -1,11 +1,4 @@
{
/*
rho = thermo.rho();
rho = max(rho, rhoMin[i]);
rho = min(rho, rhoMax[i]);
rho.relax();
*/
volScalarField rAU("rAU", 1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
@ -39,11 +32,7 @@
fvm::laplacian(rhorAUf, p_rgh) == fvc::div(phiHbyA)
);
p_rghEqn.setReference
(
pRefCell,
compressible ? getRefCellValue(p_rgh, pRefCell) : pRefValue
);
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
p_rghEqn.solve();
@ -84,8 +73,8 @@
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/compressibility;
p_rgh = p - rho*gh;
}
p_rgh = p - rho*gh;
}
rho = thermo.rho();

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -185,39 +185,17 @@ externalWallHeatFluxTemperatureFvPatchScalarField
temperatureCoupledBase(patch(), ptf),
mode_(ptf.mode_),
Q_(ptf.Q_),
q_(ptf.q_, mapper),
h_(ptf.h_, mapper),
Ta_(ptf.Ta_, mapper),
relaxation_(ptf.relaxation_),
emissivity_(ptf.emissivity_),
qrPrevious_(ptf.qrPrevious_, mapper),
qrRelaxation_(ptf.qrRelaxation_),
qrName_(ptf.qrName_),
thicknessLayers_(ptf.thicknessLayers_),
kappaLayers_(ptf.kappaLayers_)
{
switch (mode_)
{
case fixedPower:
{
break;
}
case fixedHeatFlux:
{
q_.autoMap(mapper);
break;
}
case fixedHeatTransferCoeff:
{
h_.autoMap(mapper);
Ta_.autoMap(mapper);
break;
}
}
if (qrName_ != "none")
{
qrPrevious_.autoMap(mapper);
}
}
{}
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-2017 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -469,7 +469,7 @@ void Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs()
scalarField nrbDeltaCoeffs(nbrPatch.deltaCoeffs());
mpp.distribute(nrbDeltaCoeffs);
scalarField KDeltaNbr(nbrK*nrbDeltaCoeffs);
scalarField KDeltaNbr(nbrField.kappa(*this)*nbrPatch.deltaCoeffs());
mpp.distribute(KDeltaNbr);
myKDelta_ = K*patch().deltaCoeffs();
@ -702,7 +702,6 @@ void Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs()
mixedFvPatchScalarField::updateCoeffs();
if (debug && fluid_)
{
scalar Qdm = gSum(dm);

View File

@ -22,7 +22,8 @@ done
# Generate view factors
for i in air
do
runParallel -s $i -np 4 viewFactorsGen -region $i
runParallel -s $i -np 4 \
viewFactorsGen -region $i
done
# set the initial fields

View File

@ -0,0 +1,39 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# create the underlying block mesh
runApplication blockMesh
# create the set for the obstacles
runApplication topoSet
# mesh processing to generate the inlet duct
runApplication subsetMesh c0 -patch walls -overwrite
# split into the cabin, ice and exterior regions
runApplication splitMeshRegions -cellZones -overwrite
# create register face and cell zones
rm log.topoSet
runApplication topoSet -region cabin -dict system/topoSetDictRegister
# set the initial fields
restore0Dir
# Decompose
runApplication decomposePar -allRegions -constant
runParallel $(getApplication)
# Reconstruct
runApplication reconstructPar -allRegions
echo
echo "creating files for paraview post-processing"
echo
paraFoam -touchAll
#------------------------------------------------------------------------------

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
note "mesh decomposition control dictionary";
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method scotch;
// ************************************************************************* //

View File

@ -35,7 +35,7 @@ writeControl adjustableRunTime;
purgeWrite 0;
writeFormat binary;
writeFormat ascii;
writePrecision 10;
@ -49,7 +49,7 @@ runTimeModifiable true;
adjustTimeStep yes;
maxDi 10;
maxDi 10e3;
functions
{

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
note "mesh decomposition control dictionary";
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method scotch;
// ************************************************************************* //

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
note "mesh decomposition control dictionary";
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method scotch;
// ************************************************************************* //