This is a repository that contains the source code for the assimilation of rough-wall TBL data using variational data assimilation. The original DAFoam-v3 code has been modified to implement a new type of design variable that is embedded in the nut wall function and only acts on the defined wall patch while leaving the internal flow field entirely up to the forward RANS solution. This updated code is associated with the publication: "Assimilating Rough Features: A Data-Driven Framework to Infer Rough Wall Properties from Sparse Experimental Data" by M. Formichetti et al. (2026), FTaC, DOI: 10.1007/s10494-026-00777-5.
In order to use the new design variable etaWallDV, this needs to be defined in the run.py file as:
# =============================================================================
# Input Parameters
# =============================================================================
...
daOptions = {
...,
"designVar": {
"etaWallDV": {"designVarType": "Field", "fieldName": "etaWallDV", "fieldType": "scalarPatch", "patches": ["bottom"]}
},
...}
...
# =============================================================================
# Design variable setup
# =============================================================================
DASolver = PYDAFOAM(options=daOptions, comm=gcomm)
DVGeo = DVGeometry("./FFD/rough.xyz")
DVGeo.addRefAxis("bodyAxis", xFraction=0.25, alignIndex="k")
def etaWallDV(val, geo):
for idxI, v in enumerate(val):
DASolver.setFieldValue4GlobalCellI(b"etaWallDV", v, idxI)
DASolver.updateBoundaryConditions(b"etaWallDV", b"scalarPatch")
eta0 = DASolver.getOFField("etaWallDV", "scalarPatch", False)
DVGeo.addGlobalDV("etaWallDV", value=eta0, func=etaWallDV, lower=1, upper=100.0, scale=1)Finally, the new wall function "nutUtauWallFunctionDF" has to be defined in the 0 directory on a wall patch boundary condition for nut as:
bottom
{
type nutUtauWallFunctionDF;
Ks uniform 0;
Cs uniform 0.19;
kappa 0.39;
E 5.35;
value uniform 0;
}